环境
系统:CentOS-7
CPU: 14C28T
内存:32G
显卡:Tesla P40 24G
驱动: 535
CUDA: 12.2
克隆
git clone --recursive https://github.com/FunAudioLLM/CosyVoice.git
cd CosyVoice
git submodule update --init --recursive
下载 Matcha-TTS
cd third_party
git clone https://hub.nuaa.cf/shivammehta25/Matcha-TTS.git
创建环境
conda create -n cv python=3.8
conda activate cv
安装依赖
cd .. CosyVoice目录
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
安装软件
sudo yum install sox sox-devel -y
git模型下载,请确保已安装git lfs
mkdir -p pretrained_models
git clone https://www.modelscope.cn/iic/CosyVoice-300M.git pretrained_models/CosyVoice-300M
git clone https://www.modelscope.cn/iic/CosyVoice-300M-SFT.git pretrained_models/CosyVoice-300M-SFT
git clone https://www.modelscope.cn/iic/CosyVoice-300M-Instruct.git pretrained_models/CosyVoice-300M-Instruct
git clone https://www.modelscope.cn/iic/CosyVoice-ttsfrd.git pretrained_models/CosyVoice-ttsfrd
可以先下载CosyVoice-300M-Instruct与CosyVoice-ttsfrd
安装CosyVoice-ttsfrd
cd pretrained_models/CosyVoice-ttsfrd/
unzip resource.zip -d .
pip install ttsfrd-0.3.6-cp38-cp38-linux_x86_64.whl
启动
export PYTHONPATH=third_party/Matcha-TTS
python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M-Instruct
访问
http://192.168.31.111:50000/
以上文本,在P40中大概20秒生成,GPU显存消耗 2126MiB GPU 90%~100%
参考
https://www.bilibili.com/video/BV1BE421A7CG
https://hub.nuaa.cf/FunAudioLLM/CosyVoice