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

更多内容

相关推荐
无心水19 小时前
【分布式利器:SOAF】蚂蚁开源的金融级微服务全家桶:SOFAStack 核心架构与实战选型对比
人工智能·分布式·微服务·金融·架构·开源·分布式利器
DisonTangor19 小时前
【上篇】SenseNova-U1:基于NEO-unify架构统一多模态理解与生成
人工智能·ai作画·开源·aigc
NineData19 小时前
NineData 将亮相 XCOPS 智能运维管理人年会 2026 广州站
运维·dba·开发工具·数据库管理工具·ninedata·数据库管理员·数据迁移工具
快乐的哈士奇19 小时前
历史对话关联 RAG 上下文检索 — 内部技术介绍
服务器·数据库·oracle
難釋懷19 小时前
Nginx介绍与安装
运维·nginx
windawdaysss19 小时前
使用VMware Workstation Pro安装Ubuntu虚拟机教程
linux·运维·ubuntu
土星云SaturnCloud19 小时前
32TOPS工业级算力+无风扇全密封!土星云SE110S-WA32边缘计算微服务器深度测评
服务器·人工智能·ai·边缘计算
宋浮檀s19 小时前
Linux后门持久化排查
linux·运维·服务器
诗句藏于尽头19 小时前
服务器入侵事件复盘:从发现到修复的完全指南
运维·服务器
浮尘笔记21 小时前
Java Snowy框架CI/CD云效自动化部署流程
java·运维·服务器·阿里云·ci/cd·自动化