Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
cf09e20
feat: add client/server example
johanna-reiml-hpi Nov 11, 2024
58c5d37
fix: properly load model for fastapi
johanna-reiml-hpi Nov 11, 2024
c84fc7d
feat: add docker compose deployment
johanna-reiml-hpi Nov 11, 2024
7f0cc26
fix: resampler on CUDA
johanna-reiml-hpi Nov 11, 2024
943a246
fix: use different port
johanna-reiml-hpi Nov 11, 2024
9d38484
updated the parameters for text operation
surmelienes1 Nov 11, 2024
8075af2
feat: add MODEL_FILEPATH env variable for api server
johanna-reiml-hpi Nov 12, 2024
608e8b0
feat: German finetuning with cv and Emilia datasets
johanna-reiml-hpi Nov 12, 2024
4bcd82a
feat: add German model for inference in compose
johanna-reiml-hpi Nov 12, 2024
591f580
feat: create the training, test, and validation splits
surmelienes1 Nov 21, 2024
e5cb361
fix: change the experiment name
surmelienes1 Nov 21, 2024
a43a5cc
Merge remote-tracking branch 'public/main'
johanna-reiml-hpi Nov 21, 2024
e0dd618
fix: filter out bad durations in preprocessing
johanna-reiml-hpi Nov 21, 2024
2c7a3e4
fix: create the accelerator gather logic to have consistent val loss
surmelienes1 Nov 21, 2024
935be18
fix: print bad duration cases
johanna-reiml-hpi Nov 21, 2024
fd1add9
fix: proper evaluation loss gathering
johanna-reiml-hpi Nov 21, 2024
72f0c66
fix: support vocoder name param in api_server
johanna-reiml-hpi Nov 22, 2024
2ed59e6
fix: put model back in train mode after evaluation
johanna-reiml-hpi Nov 22, 2024
b4fc267
fix: properly support bigvgan for sample generation
johanna-reiml-hpi Nov 22, 2024
79ebf73
feat: scenario generation
johanna-reiml-hpi Nov 25, 2024
9ad0b44
feat: phone processing
johanna-reiml-hpi Nov 25, 2024
9350e69
fix: long training run
johanna-reiml-hpi Nov 25, 2024
e2e1860
feat: add a function for noise supression using deep filtering
surmelienes1 Nov 25, 2024
e406ba0
fix: allow sending individual scenarios
johanna-reiml-hpi Nov 25, 2024
eae553e
feat: add server Dockerfile for bigvgan
johanna-reiml-hpi Nov 28, 2024
4b1a5bb
Fix sample timesteps
Jerrister Nov 26, 2024
b2d0b69
fix: handle different dtype with infer_batch_process
johanna-reiml-hpi Nov 30, 2024
f77be45
chore: do another german vocos training run
johanna-reiml-hpi Dec 1, 2024
95cb9cc
feat: allow fadeout for remove_silence_edges
johanna-reiml-hpi Dec 1, 2024
7747258
feat: add prototype api
johanna-reiml-hpi Dec 1, 2024
90062bb
fix: exclusive access to mutable df_state
johanna-reiml-hpi Dec 2, 2024
6084157
feat: add model upload
johanna-reiml-hpi Dec 2, 2024
154faeb
feat: use only remote models and add german vocos
johanna-reiml-hpi Dec 2, 2024
a6b5985
feat: add more vocos models
johanna-reiml-hpi Dec 3, 2024
ca4dc56
feat: phone effect
johanna-reiml-hpi Dec 3, 2024
17f84cb
fix: keep best german checkpoints
johanna-reiml-hpi Dec 6, 2024
7537f80
Add ArgoCD and Kubernetes manifests for f5-tts
felixboelter Mar 24, 2026
3dc828c
Update Dockerfiles for server builds
felixboelter Mar 24, 2026
b5e10cf
k8s changes related to deployment through argocd
kalyanikumar-shunmugasundaram Mar 27, 2026
e3173f5
k8s deployment changes through argocd
kalyanikumar-shunmugasundaram Mar 27, 2026
0d4e64c
k8s deployment changes through argocd
kalyanikumar-shunmugasundaram Mar 27, 2026
6a893f3
Update the base image to a CUDA 13.1-compatible PyTorch build
kalyanikumar-shunmugasundaram Jun 18, 2026
eea41a3
Fix broken submodule pointer: revert BigVGAN to v2.4
kalyanikumar-shunmugasundaram Jun 18, 2026
309566e
Changed the imagepullpolicy to ifnotpresent. This will ensure on pod …
kalyanikumar-shunmugasundaram Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ data/
ckpts/
wandb/
results/
kubernetes/secrets.yaml



Expand Down
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM pytorch/pytorch:2.4.0-cuda12.4-cudnn9-devel
# CUDA 13.1 + cuDNN 9 — matches node driver 590.48.01 on gx16 (A30, compute 8.0)
FROM pytorch/pytorch:2.7.0-cuda13.1-cudnn9-devel

USER root

ARG DEBIAN_FRONTEND=noninteractive
ARG TORCH_VERSION=2.7.0
ARG CUDA_TAG=cu131

LABEL github_repo="https://github.com/SWivid/F5-TTS"

Expand All @@ -15,10 +18,17 @@ RUN set -x \

WORKDIR /workspace

RUN git clone https://github.com/SWivid/F5-TTS.git \
RUN git clone https://github.com/aihpi/F5-TTS.git \
&& cd F5-TTS \
&& pip install -e .[eval]

# Force-reinstall torch + torchaudio from the official CUDA 13.1 wheel index so they
# share the same ABI regardless of what pip resolved above.
RUN pip install --no-cache-dir --force-reinstall \
torch==${TORCH_VERSION} \
torchaudio==${TORCH_VERSION} \
--index-url https://download.pytorch.org/whl/${CUDA_TAG}

ENV SHELL=/bin/bash

WORKDIR /workspace/F5-TTS
46 changes: 46 additions & 0 deletions Dockerfile.new
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# CUDA 13.1 + cuDNN 9 — matches node driver 590.48.01 on gx16 (A30, compute 8.0)
FROM pytorch/pytorch:2.7.0-cuda13.1-cudnn9-runtime

USER root
ARG DEBIAN_FRONTEND=noninteractive
ARG TORCH_VERSION=2.7.0
ARG CUDA_TAG=cu131

LABEL github_repo="https://github.com/SWivid/F5-TTS"

# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
ffmpeg \
build-essential \
&& rm -rf /var/lib/apt/lists/* && \
apt-get clean

WORKDIR /workspace

# Clone F5-TTS repo with submodules and apply BigVGAN patch
RUN git clone https://github.com/aihpi/F5-TTS \
&& cd F5-TTS \
&& git submodule update --init --recursive \
&& printf "import os\nimport sys\nsys.path.append(os.path.dirname(os.path.abspath(__file__)))\n" \
| cat - src/third_party/BigVGAN/bigvgan.py > temp && mv temp src/third_party/BigVGAN/bigvgan.py

# Copy local source code (e.g., for custom modifications)
COPY . /workspace/F5-TTS

WORKDIR /workspace/F5-TTS

# Install Python dependencies
RUN pip install --no-cache-dir -e .[eval] \
&& pip install --no-cache-dir -r src/third_party/BigVGAN/requirements.txt \
&& rm -rf ~/.cache/pip

# Force-reinstall torch + torchaudio from the official CUDA 13.1 wheel index so they
# share the same ABI regardless of what pip resolved above.
RUN pip install --no-cache-dir --force-reinstall \
torch==${TORCH_VERSION} \
torchaudio==${TORCH_VERSION} \
--index-url https://download.pytorch.org/whl/${CUDA_TAG}

ENV SHELL=/bin/bash
44 changes: 44 additions & 0 deletions Dockerfile.server
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# CUDA 13.1 + cuDNN 9 — matches node driver 590.48.01 on gx16 (A30, compute 8.0)
FROM pytorch/pytorch:2.7.0-cuda13.1-cudnn9-devel

ARG DEBIAN_FRONTEND=noninteractive

# Pinned together — torchaudio must share the same PyTorch ABI.
# Update both atomically whenever the base image is bumped.
ARG TORCH_VERSION=2.7.0
ARG CUDA_TAG=cu131

RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
ffmpeg \
build-essential \
&& rm -rf /var/lib/apt/lists/* && \
apt-get clean

WORKDIR /app

ARG GIT_REPOSITORY="https://github.com/aihpi/F5-TTS"
# Hacky workaround, as bigvgan is not properly setup to be installed as a package:
# https://github.com/aihpi/F5-TTS?tab=readme-ov-file#2-local-editable-if-also-do-training-finetuning
ARG BIGVGAN_PATCH="import os\nimport sys\nsys.path.append(os.path.dirname(os.path.abspath(__file__)))\n"

RUN git clone $GIT_REPOSITORY \
&& cd F5-TTS \
&& git submodule update --init --recursive \
&& printf "$BIGVGAN_PATCH" | cat - src/third_party/BigVGAN/bigvgan.py > temp && mv temp src/third_party/BigVGAN/bigvgan.py \
&& pip install -e .[eval] \
&& pip install -r src/third_party/BigVGAN/requirements.txt

# Force-reinstall torch + torchaudio from the official CUDA 13.1 wheel index so they
# share the same ABI regardless of what pip resolved above. This must be a separate
# RUN so Docker cache invalidation is scoped to version bumps, not source changes.
RUN pip install --no-cache-dir --force-reinstall \
torch==${TORCH_VERSION} \
torchaudio==${TORCH_VERSION} \
--index-url https://download.pytorch.org/whl/${CUDA_TAG}

# for prototyping
COPY src/f5_tts/demo/ /app/F5-TTS/src/f5_tts/demo/

CMD ["python3", "-m", "uvicorn", "f5_tts.demo.server:app", "--host", "0.0.0.0", "--port", "8000"]
20 changes: 20 additions & 0 deletions argocd/f5-tts-application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: f5-tts
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/aihpi/F5-TTS.git
targetRevision: main
path: kubernetes
destination:
server: https://kubernetes.default.svc
namespace: f5-tts
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
32 changes: 32 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
services:
f5tts_api_de:
build: .
command: python -m uvicorn f5_tts.api_server:app --host 0.0.0.0 --port 8000
ports:
- "8004:8000"
environment:
- MODEL_FILEPATH="/var/tmp/model_12600.pt"
volumes:
- /raid/shared/models/F5TTS/model_12600.pt:/var/tmp/model_12600.pt:ro
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
restart: unless-stopped

f5tts_api_en:
build: .
command: python -m uvicorn f5_tts.api_server:app --host 0.0.0.0 --port 8000
ports:
- "8005:8000"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
46 changes: 46 additions & 0 deletions kubernetes/deployments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: f5tts-api
spec:
replicas: 1
selector:
matchLabels:
app: f5tts-api
template:
metadata:
labels:
app: f5tts-api
spec:
imagePullSecrets:
- name: ghcr-credentials
nodeSelector:
accelerator: a30
containers:
- name: api
image: ghcr.io/aihpi/f5-tts-optim:latest
imagePullPolicy: IfNotPresent
command:
- python3
- -m
- uvicorn
- f5_tts.demo.server:app
- --host
- 0.0.0.0
- --port
- "8000"
env:
- name: MODEL_FILEPATH
value: /var/tmp/model_430000.safetensors
ports:
- containerPort: 8000
resources:
limits:
nvidia.com/gpu: "1"
volumeMounts:
- name: model-volume
mountPath: /var/tmp/
volumes:
- name: model-volume
persistentVolumeClaim:
claimName: f5tts-model-pvc
19 changes: 19 additions & 0 deletions kubernetes/ingresses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: f5tts-api-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: tts.aisc.hpi.de
http:
paths:
- path: /api(/|$)(.*)
pathType: Prefix
backend:
service:
name: f5tts-api
port:
number: 8004
9 changes: 9 additions & 0 deletions kubernetes/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: f5-tts
resources:
- namespace.yaml
- deployments.yaml
- services.yaml
- ingresses.yaml
- persistentvolumeclaims.yaml
4 changes: 4 additions & 0 deletions kubernetes/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: f5-tts
11 changes: 11 additions & 0 deletions kubernetes/persistentvolumeclaims.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: f5tts-model-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: nfs-k8s-general
resources:
requests:
storage: 10Gi
20 changes: 20 additions & 0 deletions kubernetes/secrets.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Example secrets only. Do not commit real credentials here.
apiVersion: v1
kind: Secret
metadata:
name: ghcr-credentials
namespace: f5-tts
type: kubernetes.io/dockerconfigjson
stringData:
.dockerconfigjson: |
{"auths":{"ghcr.io":{"username":"<ghcr-username>","password":"<ghcr-token>","email":"<email@example.com>","auth":"<base64(username:token)>"}}}
---
apiVersion: v1
kind: Secret
metadata:
name: f5tts-ui-env
namespace: f5-tts
type: Opaque
stringData:
API_USER: "<replace-me>"
API_PASSWORD: "<replace-me>"
13 changes: 13 additions & 0 deletions kubernetes/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: f5tts-api
spec:
type: NodePort
selector:
app: f5tts-api
ports:
- port: 8004
targetPort: 8000
protocol: TCP
nodePort: 31493
13 changes: 13 additions & 0 deletions kubernetes/ui-repo-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: github-private-repo
namespace: argocd
labels:
argocd.argoproj.io/secret-type: repository # Required label
type: Opaque
stringData:
type: git
url: https://github.com/aihpi/demo-tts.git
username: kalyanikumar-shunmugasundaram
password: <your-fine-grained-token>
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ dependencies = [
"safetensors",
"soundfile",
"tomli",
"torch>=2.0.0",
"torchaudio>=2.0.0",
"torch>=2.7.0,<3.0.0",
"torchaudio>=2.7.0,<3.0.0",
"torchdiffeq",
"tqdm>=4.65.0",
"transformers",
Expand All @@ -49,6 +49,8 @@ eval = [
"modelscope",
"zhconv",
"zhon",
"loguru",
"DeepFilterNet",
]

[project.urls]
Expand Down
32 changes: 32 additions & 0 deletions src/f5_tts/demo/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Define model constants
MODEL_CHECKPOINTS = {
# German vocos checkpoints
"kisz-german-vocos": "hf://aihpi/F5-TTS-German/F5TTS_Base/model_365000.safetensors",
# German bigvgan checkpoints
"kisz-german-bigvgan": "hf://aihpi/F5-TTS-German/F5TTS_Base_bigvgan/model_430000.safetensors",
# English checkpoints
"original-english-vocos": "hf://SWivid/F5-TTS/F5TTS_Base/model_1200000.pt",
"original-english-bigvgan": "hf://SWivid/F5-TTS/F5TTS_Base_bigvgan/model_1250000.pt"
}

MODEL_METADATA = {
# German vocos checkpoints
"kisz-german-vocos": {
"vocoder_name": "vocos",
"language": "de"
},
# German bigvgan checkpoints
"kisz-german-bigvgan": {
"vocoder_name": "bigvgan",
"language": "de"
},
# English checkpoints
"original-english-vocos": {
"vocoder_name": "vocos",
"language": "en"
},
"original-english-bigvgan": {
"vocoder_name": "bigvgan",
"language": "en"
}
}
Loading