欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 时评 > 开源语音克隆项目 OpenVoice V2 本地部署

开源语音克隆项目 OpenVoice V2 本地部署

2025/2/21 4:34:36 来源:https://blog.csdn.net/qq_30612221/article/details/145649520  浏览:    关键词:开源语音克隆项目 OpenVoice V2 本地部署

#本机环境

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基础 )

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词