FunAudioLLM / CosyVoice

Multi-lingual large voice generation model, providing inference, training and deployment full-stack ability.
https://funaudiollm.github.io/
Apache License 2.0
6.35k stars 677 forks source link

我该如何像别的fastapi项目一样开启多个workers 呢? #431

Open likuangyu01 opened 1 month ago

likuangyu01 commented 1 month ago

Describe the bug when i use fastapi run the server.py, i want add workers , like this if name == 'main': parser = argparse.ArgumentParser() parser.add_argument('--port', type=int, default=50000) parser.add_argument('--model_dir', type=str, default='iic/CosyVoice-300M', help='local path or modelscope repo id') args = parser.parse_args() cosyvoice = CosyVoice(args.model_dir) uvicorn.run("server:app", port=50000, host="0.0.0.0", workers=4) but when i add workers=4 get errors

INFO: Waiting for child process [920026] INFO: Child process [920026] died 子进程一直没办法启动,这个错误会一直循环,我该如何像别的fastapi项目一样开启多个workers 呢? 感谢回复

aluminumbox commented 1 month ago

check uvicorn example, uvicorn main:app --host 0.0.0.0 --port 80. we have no experience in this

likuangyu01 commented 1 month ago

检查 uvicorn 示例,uvicorn main:app --host 0.0.0.0 --port 80。我们在这方面没有经验

If there is no workers parameter, then by default, one process is enabled. However, when I want to open multiple processes to increase concurrency, how should I handle it

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity.