-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathDockerfile.server
More file actions
44 lines (35 loc) · 1.77 KB
/
Copy pathDockerfile.server
File metadata and controls
44 lines (35 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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"]