#本機環境
WIN11 I5
GPU 4060ti 16G
內存 32G
#開始
git clone https://github.com/myshell-ai/OpenVoice.git
conda create -n opvenv python=3.9 -y
conda activate opvenv ?
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
pip install git+https://github.com/myshell-ai/MeloTTS.git
# 需要翻墻?
python -m unidic download
###
unidic無法下載問題:
1. 從 https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip 中下載
2. 把下載后的文件 你的文件根目錄/miniconda3/envs/tts/lib/site-packages/unidic,并把 unidic-3.1.0.zip 重命名為 unidic.zip
3. 修改 download.py,找到 93 行,也就是在 download_version() 函數中,注釋掉除了 download_and_clean() 之外的內容
4. 修改 download_and_clean() 中的參數,你可以隨意設置
5. 修改 download.py 中的 63 行,注釋 download_process()
6. 執行 python -m unidic download
###
cotonoha-dic.s3-ap-northeast-1.amazonaws.com
###
# 下載模型
?https://myshell-public-repo-host.s3.amazonaws.com/openvoice/checkpoints_1226.zip
https://myshell-public-repo-host.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip
解壓后> ( 參考 USAGE.md 文件內容)
#下載ffmpeg?
conda install -c conda-forge ffmpeg
#啟動
python -m openvoice_app --share
# 問題
文件openvoice_app.py 移動到上一層文件夾 ,同時修改OpenVoice -> openvoice,否則提示模塊找不到
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
??import gradio as gr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ?出現:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
?ctx = ssl.create_default_context(cafile=os.environ["SSL_CERT_FILE"])? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
解決> (同時處理 ?https://huggingface.co 無法訪問)
2 修改源代碼文件open voice.py? 在最開頭添加以下代碼:
import ssl
# 檢查并刪除 SSL_CERT_FILE 環境變量
if "SSL_CERT_FILE" in os.environ:
? ? del os.environ["SSL_CERT_FILE"]
os.environ['HF_ENDPOINT'] = "https://hf-mirror.com"
#外網映射:
1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_windows_amd64.exe
2. Rename the downloaded file to: frpc_windows_amd64_v0.2
3. Move the file to this location: C:\DevTools\anaconda3\envs\opvenv\lib\site-packages\gradio
?
#其他可能問題
nltk.data.find('taggers/averaged_perceptron_tagger.zip') 找不到或下載不了
一、下載數據文件
官方數據在https://github.com/nltk/nltk_data/tree/gh-pages中,不過,在github上下載文件也挺慢的。
所以,這里我們可以去碼云上找到對應的項目https://gitee.com/qwererer2/nltk_data/tree/gh-pages/(鏈接如果失效可以在碼云自行搜索nltk_data)。?
下載得到nltk_data-gh-pages.zip文件。
要把解壓出來的文件夾package挪到對應的nltk搜索目錄下并且將packages文件夾重新命名為nltk_data。
怎么查詢nltk的搜索路徑>>
import nltk
nltk.find('.')
輸出:
FileSystemPathPointer('C:\\DevTools\\anaconda3\\envs\\opvenv\\share\\nltk_data')
各系統路徑可能不同 按實際路徑操作
?
成功后>
使用openVoice V2的辦法: (參考?demo_part3.ipynb ) 直接把里面python代碼拷貝到一個py文件內, 直接執行 ( 需要一定python基礎 )