服务器部署网易开源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

更多内容

相关推荐
飞奔的瓜牛43 分钟前
Wireshark 抓包实战:呼叫中心项目中的 SIP、DTMF 与 RTP 分析
运维·wireshark
Decay__2 小时前
SQLServer 监控体系构建 —— sql_exporter + Prometheus + Grafana 全栈实战
运维·数据库·sql·mysql·架构
遇雪长安2 小时前
wslc 来了:Docker Desktop 还要留着吗?
运维·docker·容器
csdn_aspnet3 小时前
【Docker 攻略】MySQL 安裝篇
运维·mysql·docker·容器
艺杯羹3 小时前
ufw 已 active,Docker 端口却仍对外开放的复盘
运维·docker·容器
无奈笑天下4 小时前
银河麒麟桌面操作系统上磁盘无法自动挂载问题处理
linux·运维·服务器
Z21-X5 小时前
云原生运维学习笔记:从操作系统底层到 Kubernetes 集群的深度实践
运维·笔记·学习·云原生·kubernetes
星恒随风5 小时前
MySQL 从零入门(七):索引原理与 B+ 树详解——从磁盘 I/O 到 InnoDB 聚簇索引
linux·服务器·数据库·笔记·mysql
IT大白鼠15 小时前
彭大帅的AI运维助手第 10 篇——K8s 集群探针升级记:从服务级到业务级
运维·kubernetes·aiops·彭大帅
wflynn19 小时前
GitHub 今日推荐|kiri:clone3 系统调用直达容器,2.5 毫秒启动无 runc 中间层
docker·rust·kubernetes·开源·github·containers