FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

c++ runtime 2pass 循环解码同一句话,会使得offline模型解码越来越慢吗?

Open locasxe opened this issue 1 year ago • 0 comments

❓ Questions and Help

What is your question?

运行 runtime 源码,加入循环,解码(音频内容为 123456789),重复大概几千遍,解码的速率会越来越慢,希望可以看看什么原因

Code

demo改动如下: for (int ii = 0; ii < 10000; ii++) { # 推理的时候加入了这个循环。 for (int sample_offset = 0; sample_offset < buff_len; sample_offset += std::min(step, buff_len - sample_offset)) { if (sample_offset + step >= buff_len - 1) { step = buff_len - sample_offset; is_final = false; # 测试的时候不输入尾点 } else { is_final = false; } gettimeofday(&start, nullptr); FUNASR_RESULT result = FunTpassInferBuffer(tpass_handle, tpass_online_handle, speech_buff+sample_offset, step, punc_cache, is_final, sampling_rate_, "pcm", (ASR_TYPE)asr_mode_, hotwords_embedding, true, decoder_handle); gettimeofday(&end, nullptr); seconds = (end.tv_sec - start.tv_sec); taking_micros += ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);

What's your environment?

  • OS Linux:
  • FunASR Version 最新:
  • ModelScope Version 最新:
  • PyTorch Version 2.0.0:
  • How you installed funasr source:
  • Python version 3.9:
  • GPU T4
  • CUDA/cuDNN version 12.0: 希望大佬们解答下

locasxe avatar Aug 28 '24 09:08 locasxe