FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

model.generate 支持异步或多线程

Open bebilli opened this issue 7 months ago • 0 comments

Notice: In order to resolve issues more efficiently, please raise issue following the template. (注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)

❓ Questions and Help

我查看过往的issue,发现model.generate 不支持异步或多线程,这样的话就需要加锁,或为每一个任务分别加载一次model,在高并发下,这样会显著降低吞吐量。如果因为GIL 问题没有意义,是否在model对象的内部设计一个进程池,来提高吞吐量,而不是交给用户去多进程加载N次模型从而导致显存无意义的冗余占用?

What's your environment?

  • OS (Windows)
  • FunASR Version (1.2.6)
  • ModelScope Version (v2.0.4)
  • PyTorch Version (2.6)
  • How you installed funasr (pip)
  • Python version: 3.12
  • GPU (4090)
  • CUDA/cuDNN version (12.6)

bebilli avatar Apr 09 '25 15:04 bebilli