F5-TTS wrap module
Go to file
2025-02-28 16:28:53 +08:00
app bugfix 2024-12-25 16:04:39 +08:00
conf bugfix 2024-12-26 10:35:44 +08:00
logs bugfix 2024-12-25 16:04:39 +08:00
samples bugfix 2024-10-23 18:38:56 +08:00
script bugfix 2024-12-25 16:04:39 +08:00
wwwroot bugfix 2024-12-25 16:04:39 +08:00
install bugfix 2024-12-25 16:04:39 +08:00
README.md bugfix 2025-02-28 16:28:53 +08:00
requirements.txt bugfix 2025-02-28 15:13:06 +08:00

包装F5-TTS为一个服务

依赖

分为系统级依赖和python依赖

操作系统级别

  • 安装FFMpeg
sudo apt install ffmpeg
  • 安装GPU卡驱动 英伟达驱动按照显卡类型到英伟达网站下载后,执行
sudo sh 下载的驱动文件

python依赖

  • 安装F5-tts相关依赖
pip install torch==2.3.0+cu118 torchaudio==2.3.0+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
  • 安装F5-TTS
pip install git+https://github.com/SWivid/F5-TTS.git
  • 安装其他依赖
pip install git+https://git.kaiyuancloud.cn/yumoqing/apppublic.git
pip install git+https://git.kaiyuancloud.cn/yumoqing/sqlor.git
pip install git+https://git.kaiyuancloud.cn/yumoqing/ahserver.git
pip install cn2an pycld2

安装与部署

执行下列步骤

  • 安装操作系统依赖
  • 添加操作系统用户f5tts
  • 登录f5tts用户
  • 安装python依赖
  • 克隆项目
  • 运行环境设置
  • 启动
  • 停止

* 克隆项目

cd ~ git clone git@git.kaiyuancloud.cn:yumoqing/f5tts.git mv f5tts/* ~ rm -rf f5tts


* 运行环境设置

cd script bash install.sh


* 启动

sudo systemctl start f5tts

* 停止

killname f5tts.py

## API

### 添加播音员
url/api/addvoice
方法POST
上传数据
speaker:播音员名称
ref_audio声音文件
ref_text: 录音相应的文字
返回添加成功返回UiMessage的json文件
	出错则返回UiError的json文件

### TTS转换
url:/api/inference
方法POST
数据:
prompt:正文文本
speaker播音员名

### TTS流式转换