服务器部署网易开源TTS | EmotiVoice部署教程

一、环境

markdown 复制代码
ubuntu 20.04
python 3.8
cuda 11.8

二、部署

1、docker方式部署

1.1、安装docker

如何安装docker,可以参考这篇文章

1.2、拉取镜像

shell 复制代码
docker run -dp 127.0.0.1:8501:8501 syq163/emoti-voice:latest

2、完整安装

安装python依赖

shell 复制代码
conda create -n EmotiVoice python=3.8 -y
conda activate EmotiVoice
pip install torch torchaudio
pip install numpy numba scipy transformers==4.26.1 soundfile yacs g2p_en jieba pypinyin

安装git lfs和下载模型

shell 复制代码
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
git lfs install
git lfs clone https://huggingface.co/WangZeJun/simbert-base-chinese WangZeJun/simbert-base-chinese

下载预训练模型

shell 复制代码
https://drive.google.com/drive/folders/1y6Xwj_GG9ulsAonca_unSGbJ4lxbNymM

将预训练模型放在源码中的位置

shell 复制代码
WangZeJun/simbert-base-chinese

下载源码

shell 复制代码
git clone https://github.com/lukeewin/EmotiVoice.git

在源码路径中创建目录保存预训练模型

shell 复制代码
mkdir -p outputs/style_encoder/ckpt
mkdir -p outputs/prompt_tts_open_source_joint/ckpt

g_*, do_*文件放到outputs/prompt_tts_open_source_joint/ckpt,将checkpoint_*放到outputs/style_encoder/ckpt

推理输入文本格式是:<speaker>|<style_prompt/emotion_prompt/content>|<phoneme>|<content>

  • 例如: 8051|非常开心|<sos/eos> uo3 sp1 l ai2 sp0 d ao4 sp1 b ei3 sp0 j ing1 sp3 q ing1 sp0 h ua2 sp0 d a4 sp0 x ve2 <sos/eos>|我来到北京,清华大学
  • 其中的音素(phonemes)可以这样得到:python frontend.py data/my_text.txt > data/my_text_for_tts.txt.
python 复制代码
TEXT=data/inference/text
python inference_am_vocoder_joint.py \
--logdir prompt_tts_open_source_joint \
--config_folder config/joint \
--checkpoint g_00140000 \
--test_file $TEXT

合成的语音结果在:outputs/prompt_tts_open_source_joint/test_audio

python 复制代码
pip install streamlit
streamlit run demo_page.py

更多内容

相关推荐
可口码农7 分钟前
Kwrt软路由从“路由模式”改为“交换机模式”,再改为旁路由模式接管 DHCP 的透明网关模式。
运维·服务器
奶油话梅糖9 分钟前
解决Windows SSH无法连接老旧网络设备(路由器交换机)
运维·windows·ssh
源代码•宸10 分钟前
goframe框架签到系统项目开发(用户认证、基于 JWT 实现认证、携带access token获取用户信息)
服务器·开发语言·网络·分布式·后端·golang·jwt
广州服务器托管13 分钟前
[2025.12.25] Win10.LTSC2021极速响应养老版19045.3208轻精简全功能【可更新】PIIS出品 老电脑福利 老旧电脑流畅运行
运维·人工智能·计算机网络·云计算·电脑·可信计算技术
刺客xs19 分钟前
TCP服务器并发编程
服务器·网络协议·tcp/ip
峰顶听歌的鲸鱼20 分钟前
20.MySql数据库
运维·数据库·笔记·mysql·云计算·学习方法
危笑ioi20 分钟前
本地使用 virtualbox 部署 ubuntu 镜像
服务器
G_H_S_3_22 分钟前
【网络运维】SQL 语言:MySQL数据库基础与管理
运维·网络·数据库·mysql
清平乐的技术专栏23 分钟前
电脑参数自检-BIOS
运维·服务器·电脑
石油人单挑所有23 分钟前
VsCode无法与远端服务器建立连接的解决方案
服务器·ide·vscode