Open steveoon opened 1 month ago
https://github.com/vllm-project/vllm/issues/3510
这个issue可能能起到一些参考作用
不用Zero部署时没有这个问题. 但如果支持的话, 会非常开心
如果需要部署 huggingface zero 建议使用 https://github.com/lenML/ChatTTS-Forge/tags 下的稳定版本 最新的开发代码不保证支持 zero 环境,zero 环境部署效果可以参考 readme 中的 hf 在线体验地址
如果需要部署 huggingface zero 建议使用 https://github.com/lenML/ChatTTS-Forge/tags 下的稳定版本 最新的开发代码不保证支持 zero 环境,zero 环境部署效果可以参考 readme 中的 hf 在线体验地址
@zhzLuke96 用0.7.0
版本gradio方式部署在zero, 还是会报同样问题: 不能在主进程中初始化CUDA, 这个问题发生在API调用时,如果在webui直接使用似乎没发现这个问题
哦你是准备用api啊,我们的api是基于fastapi开发的,没法直接在zero环境用,zero环境只支持gradio运行时,zero和gradio依赖很深,不管是唤醒zero还是调度zero任务都依赖gradio运行时,所以没法脱离gradio sdk部署和使用zero环境
建议用非zero配置启动spaces
或者,尝试简单魔改一下,把我们的api替换成,gradio自带的那个自动生成的REST API(那个api应该可以在zero环境使用,因为调度逻辑都是gradio内部的)
确认清单
Forge Commit 或者 Tag
✨ add script.spk.code_to_spk
Python 版本
python:3.10.13
PyTorch 版本
pytorch-lightning==2.4.0/vector-quantize-pytorch==1.16.2
操作系统信息
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
BUG 描述
部署项目到HF的Space后启动了API服务,然后调用时报错:
RuntimeError: CUDA must not be initialized in the main process on Spaces with Stateless GPU environment.
下面有详细错误日志BUG 端点
/v1/audio/speech
复现参数
期望结果
可在HuggingFace中正常调用接口
原因和解决方案:
实际结果
报错:
RuntimeError: CUDA must not be initialized in the main process on Spaces with Stateless GPU environment.
这个错误表明,在 Hugging Face Spaces 的无状态 GPU 环境中,CUDA(NVIDIA 的并行计算平台)不应该在主进程中初始化。
错误信息