mirror of
https://github.com/FunAudioLLM/CosyVoice.git
synced 2026-02-05 18:09:24 +08:00
Merge branch 'main' of github.com:FunAudioLLM/CosyVoice into main
This commit is contained in:
@@ -69,8 +69,6 @@
|
|||||||
``` 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 platforms.
|
|
||||||
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
|
# If you encounter sox compatibility issues
|
||||||
@@ -106,7 +104,7 @@ git clone https://www.modelscope.cn/iic/CosyVoice-ttsfrd.git pretrained_models/C
|
|||||||
|
|
||||||
Optionally, you can unzip `ttsfrd` resource and install `ttsfrd` package for better text normalization performance.
|
Optionally, you can unzip `ttsfrd` resource and install `ttsfrd` package for better text normalization performance.
|
||||||
|
|
||||||
Notice that this step is not necessary. If you do not install `ttsfrd` package, we will use WeTextProcessing by default.
|
Notice that this step is not necessary. If you do not install `ttsfrd` package, we will use wetext by default.
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
cd pretrained_models/CosyVoice-ttsfrd/
|
cd pretrained_models/CosyVoice-ttsfrd/
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ try:
|
|||||||
import ttsfrd
|
import ttsfrd
|
||||||
use_ttsfrd = True
|
use_ttsfrd = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("failed to import ttsfrd, use WeTextProcessing instead")
|
print("failed to import ttsfrd, use wetext instead")
|
||||||
from tn.chinese.normalizer import Normalizer as ZhNormalizer
|
from wetext import Normalizer as ZhNormalizer
|
||||||
from tn.english.normalizer import Normalizer as EnNormalizer
|
from wetext import Normalizer as EnNormalizer
|
||||||
use_ttsfrd = False
|
use_ttsfrd = False
|
||||||
from cosyvoice.utils.file_utils import logging
|
from cosyvoice.utils.file_utils import logging
|
||||||
from cosyvoice.utils.frontend_utils import contains_chinese, replace_blank, replace_corner_mark, remove_bracket, spell_out_number, split_paragraph, is_only_punctuation
|
from cosyvoice.utils.frontend_utils import contains_chinese, replace_blank, replace_corner_mark, remove_bracket, spell_out_number, split_paragraph, is_only_punctuation
|
||||||
@@ -68,7 +68,7 @@ class CosyVoiceFrontEnd:
|
|||||||
'failed to initialize ttsfrd resource'
|
'failed to initialize ttsfrd resource'
|
||||||
self.frd.set_lang_type('pinyinvg')
|
self.frd.set_lang_type('pinyinvg')
|
||||||
else:
|
else:
|
||||||
self.zh_tn_model = ZhNormalizer(remove_erhua=False, full_to_half=False, overwrite_cache=True)
|
self.zh_tn_model = ZhNormalizer(remove_erhua=False)
|
||||||
self.en_tn_model = EnNormalizer()
|
self.en_tn_model = EnNormalizer()
|
||||||
self.inflect_parser = inflect.engine()
|
self.inflect_parser = inflect.engine()
|
||||||
|
|
||||||
|
|||||||
@@ -36,5 +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
|
||||||
WeTextProcessing==1.0.3
|
wetext==0.0.4
|
||||||
wget==3.2
|
wget==3.2
|
||||||
|
|||||||
Reference in New Issue
Block a user