Views
No views yet
1# Create a python 3.10 conda env (you could also use virtualenv)
2conda create -n f5-tts python=3.10
3conda activate f5-ttsbash1# Install pytorch with your CUDA version, e.g. 2pip install torch==2.4.0+cu124 torchaudio==2.4.0+cu124 --extra-index-url https://download.pytorch.org/whl/cu124
bash1# Install pytorch with your ROCm version (Linux only), e.g. 2pip install torch==2.5.1+rocm6.2 torchaudio==2.5.1+rocm6.2 --extra-index-url https://download.pytorch.org/whl/rocm6.2
bash1# Install pytorch with your XPU version, e.g. 2# Intel® Deep Learning Essentials or Intel® oneAPI Base Toolkit must be installed 3pip install torch torchaudio --index-url https://download.pytorch.org/whl/test/xpu 4 5# Intel GPU support is also available through IPEX (Intel® Extension for PyTorch) 6# IPEX does not require the Intel® Deep Learning Essentials or Intel® oneAPI Base Toolkit 7# See: https://pytorch-extension.intel.com/installation?request=platform
bash1# Install the stable pytorch, e.g. 2pip install torch torchaudio
1. As a pip package (if just for inference)
pip install f5-tts2. Local editable (if also do training, finetuning)
bash1git clone https://github.com/SWivid/F5-TTS.git 2cd F5-TTS 3# git submodule update --init --recursive # (optional, if need > bigvgan) 4pip install -e .
1# Build from Dockerfile
2docker build -t f5tts:v1 .
3
4# Run from GitHub Container Registry
5docker container run --rm -it --gpus=all --mount 'type=volume,source=f5-tts,target=/root/.cache/huggingface/hub/' -p 7860:7860 ghcr.io/swivid/f5-tts:main
6
7# Quickstart if you want to just run the web interface (not CLI)
8docker container run --rm -it --gpus=all --mount 'type=volume,source=f5-tts,target=/root/.cache/huggingface/hub/' -p 7860:7860 ghcr.io/swivid/f5-tts:main f5-tts_infer-gradio --host 0.0.0.0| Model | Concurrency | Avg Latency | RTF | Mode |
|---|---|---|---|---|
| F5-TTS Base (Vocos) | 2 | 253 ms | 0.0394 | Client-Server |
| F5-TTS Base (Vocos) | 1 (Batch_size) | - | 0.0402 | Offline TRT-LLM |
| F5-TTS Base (Vocos) | 1 (Batch_size) | - | 0.1467 | Offline Pytorch |
1# Launch a Gradio app (web interface)
2f5-tts_infer-gradio
3
4# Specify the port/host
5f5-tts_infer-gradio --port 7860 --host 0.0.0.0
6
7# Launch a share link
8f5-tts_infer-gradio --share1services:
2 f5-tts:
3 image: ghcr.io/swivid/f5-tts:main
4 ports:
5 - "7860:7860"
6 environment:
7 GRADIO_SERVER_PORT: 7860
8 entrypoint: ["f5-tts_infer-gradio", "--port", "7860", "--host", "0.0.0.0"]
9 deploy:
10 resources:
11 reservations:
12 devices:
13 - driver: nvidia
14 count: 1
15 capabilities: [gpu]
16
17volumes:
18 f5-tts:
19 driver: local1# Run with flags
2# Leave --ref_text "" will have ASR model transcribe (extra GPU memory usage)
3f5-tts_infer-cli --model F5TTS_v1_Base \
4--ref_audio "provide_prompt_wav_path_here.wav" \
5--ref_text "The content, subtitle or transcription of reference audio." \
6--gen_text "Some text you want TTS model generate for you."
7
8# Run with default setting. src/f5_tts/infer/examples/basic/basic.toml
9f5-tts_infer-cli
10# Or with your own .toml file
11f5-tts_infer-cli -c custom.toml
12
13# Multi voice. See src/f5_tts/infer/README.md
14f5-tts_infer-cli -c src/f5_tts/infer/examples/multi/story.toml1# Quick start with Gradio web interface
2f5-tts_finetune-gradio1pip install pre-commit
2pre-commit installpre-commit run --all-files@article{chen-etal-2024-f5tts,
title={F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching},
author={Yushen Chen and Zhikang Niu and Ziyang Ma and Keqi Deng and Chunhui Wang and Jian Zhao and Kai Yu and Xie Chen},
journal={arXiv preprint arXiv:2410.06885},
year={2024},
}