mirror of
https://github.com/FunAudioLLM/CosyVoice.git
synced 2026-02-04 17:39:25 +08:00
Merge branch 'main' into dev/lyuxiang.lx
This commit is contained in:
52
README.md
52
README.md
@@ -53,34 +53,34 @@
|
|||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
**Clone and install**
|
### Clone and install
|
||||||
|
|
||||||
- Clone the repo
|
- Clone the repo
|
||||||
``` sh
|
``` sh
|
||||||
git clone --recursive https://github.com/FunAudioLLM/CosyVoice.git
|
git clone --recursive https://github.com/FunAudioLLM/CosyVoice.git
|
||||||
# If you failed to clone submodule due to network failures, please run following command until success
|
# If you failed to clone submodule due to network failures, please run following command until success
|
||||||
cd CosyVoice
|
cd CosyVoice
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
```
|
```
|
||||||
|
|
||||||
- Install Conda: please see https://docs.conda.io/en/latest/miniconda.html
|
- Install Conda: please see https://docs.conda.io/en/latest/miniconda.html
|
||||||
- Create Conda env:
|
- Create Conda env:
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
conda create -n cosyvoice -y python=3.10
|
conda create -n cosyvoice -y python=3.10
|
||||||
conda activate cosyvoice
|
conda activate cosyvoice
|
||||||
# pynini is required by WeTextProcessing, use conda to install it as it can be executed on all platform.
|
# pynini is required by WeTextProcessing, use conda to install it as it can be executed on all platform.
|
||||||
conda install -y -c conda-forge pynini==2.1.5
|
conda install -y -c conda-forge pynini==2.1.5
|
||||||
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
|
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
|
||||||
|
|
||||||
|
# If you encounter sox compatibility issues
|
||||||
|
# ubuntu
|
||||||
|
sudo apt-get install sox libsox-dev
|
||||||
|
# centos
|
||||||
|
sudo yum install sox sox-devel
|
||||||
|
```
|
||||||
|
|
||||||
# If you encounter sox compatibility issues
|
### Model download
|
||||||
# ubuntu
|
|
||||||
sudo apt-get install sox libsox-dev
|
|
||||||
# centos
|
|
||||||
sudo yum install sox sox-devel
|
|
||||||
```
|
|
||||||
|
|
||||||
**Model download**
|
|
||||||
|
|
||||||
We strongly recommend that you download our pretrained `CosyVoice2-0.5B` `CosyVoice-300M` `CosyVoice-300M-SFT` `CosyVoice-300M-Instruct` model and `CosyVoice-ttsfrd` resource.
|
We strongly recommend that you download our pretrained `CosyVoice2-0.5B` `CosyVoice-300M` `CosyVoice-300M-SFT` `CosyVoice-300M-Instruct` model and `CosyVoice-ttsfrd` resource.
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ pip install ttsfrd_dependency-0.1-py3-none-any.whl
|
|||||||
pip install ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl
|
pip install ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl
|
||||||
```
|
```
|
||||||
|
|
||||||
**Basic Usage**
|
### Basic Usage
|
||||||
|
|
||||||
We strongly recommend using `CosyVoice2-0.5B` for better performance.
|
We strongly recommend using `CosyVoice2-0.5B` for better performance.
|
||||||
Follow code below for detailed usage of each model.
|
Follow code below for detailed usage of each model.
|
||||||
@@ -128,7 +128,7 @@ from cosyvoice.utils.file_utils import load_wav
|
|||||||
import torchaudio
|
import torchaudio
|
||||||
```
|
```
|
||||||
|
|
||||||
**CosyVoice2 Usage**
|
#### CosyVoice2 Usage
|
||||||
```python
|
```python
|
||||||
cosyvoice = CosyVoice2('pretrained_models/CosyVoice2-0.5B', load_jit=False, load_trt=False, load_vllm=False, fp16=False)
|
cosyvoice = CosyVoice2('pretrained_models/CosyVoice2-0.5B', load_jit=False, load_trt=False, load_vllm=False, fp16=False)
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ for i, j in enumerate(cosyvoice.inference_instruct('在面对挑战时,他展
|
|||||||
torchaudio.save('instruct_{}.wav'.format(i), j['tts_speech'], cosyvoice.sample_rate)
|
torchaudio.save('instruct_{}.wav'.format(i), j['tts_speech'], cosyvoice.sample_rate)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Start web demo**
|
#### Start web demo
|
||||||
|
|
||||||
You can use our web demo page to get familiar with CosyVoice quickly.
|
You can use our web demo page to get familiar with CosyVoice quickly.
|
||||||
|
|
||||||
@@ -225,11 +225,11 @@ Please see the demo website for details.
|
|||||||
python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M
|
python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M
|
||||||
```
|
```
|
||||||
|
|
||||||
**Advanced Usage**
|
#### Advanced Usage
|
||||||
|
|
||||||
For advanced user, we have provided train and inference scripts in `examples/libritts/cosyvoice/run.sh`.
|
For advanced user, we have provided train and inference scripts in `examples/libritts/cosyvoice/run.sh`.
|
||||||
|
|
||||||
**Build for deployment**
|
#### Build for deployment
|
||||||
|
|
||||||
Optionally, if you want service deployment,
|
Optionally, if you want service deployment,
|
||||||
you can run following steps.
|
you can run following steps.
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
conformer==0.3.2
|
conformer==0.3.2
|
||||||
deepspeed==0.15.1; sys_platform == 'linux'
|
deepspeed==0.15.1; sys_platform == 'linux'
|
||||||
diffusers==0.29.0
|
diffusers==0.29.0
|
||||||
|
fastapi==0.115.6
|
||||||
|
fastapi-cli==0.0.4
|
||||||
gdown==5.1.0
|
gdown==5.1.0
|
||||||
gradio==5.4.0
|
gradio==5.4.0
|
||||||
grpcio==1.57.0
|
grpcio==1.57.0
|
||||||
@@ -34,7 +36,5 @@ torch==2.3.1
|
|||||||
torchaudio==2.3.1
|
torchaudio==2.3.1
|
||||||
transformers==4.40.1
|
transformers==4.40.1
|
||||||
uvicorn==0.30.0
|
uvicorn==0.30.0
|
||||||
wget==3.2
|
|
||||||
fastapi==0.115.6
|
|
||||||
fastapi-cli==0.0.4
|
|
||||||
WeTextProcessing==1.0.3
|
WeTextProcessing==1.0.3
|
||||||
|
wget==3.2
|
||||||
|
|||||||
Reference in New Issue
Block a user