Skip to content

Commit

Permalink
Dockerfile with uv. You can test with:
Browse files Browse the repository at this point in the history
  docker build . -t coqui
  mkdir output
  docker run -it -v ./output:/app/output coqui --text "Text for TTS" --out_path output/speech.wav
  • Loading branch information
JonghoKim-Harry committed Nov 16, 2024
1 parent dbf1a08 commit 3515c24
Show file tree
Hide file tree
Showing 3 changed files with 2,347 additions and 12 deletions.
27 changes: 16 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
ARG BASE=nvidia/cuda:11.8.0-base-ubuntu22.04
FROM ${BASE}
FROM ${BASE} AS builder

RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y --no-install-recommends gcc g++ make python3 python3-dev python3-pip python3-venv python3-wheel espeak-ng libsndfile1-dev && rm -rf /var/lib/apt/lists/*
RUN pip3 install llvmlite --ignore-installed
WORKDIR /app
RUN apt update && apt upgrade -y && apt install -y curl build-essential libsndfile1-dev

# Install Dependencies:
RUN pip3 install torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu118
RUN rm -rf /root/.cache/pip
# Install rustup
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Copy TTS repository contents:
WORKDIR /root
COPY . /root
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

RUN make install
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project --no-dev
COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
ENV PATH="/app/.venv/bin:$PATH"

ENTRYPOINT ["tts"]
CMD ["--help"]
65 changes: 64 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
[project]
name = "coqui-tts"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.9, <3.10"
dependencies = [
"pip",
"numpy==1.22.0",
"numba>=0.57.0",
"scipy>=1.11.2",
"torch>=2.1",
"torchaudio",
"soundfile>=0.12.0",
"librosa>=0.10.0",
"scikit-learn>=1.3.0",
"inflect>=5.6.0",
"tqdm>=4.64.1",
"anyascii>=0.3.0",
"pyyaml>=6.0",
"fsspec>=2023.6.0", # <= 2023.9.1 makes aux tests fail
"aiohttp>=3.8.1",
"packaging>=23.1",
"mutagen==1.47.0",
# deps for examples
"flask>=2.0.1",
# deps for inference
"pysbd>=0.3.4",
# deps for notebooks
"umap-learn>=0.5.1",
"pandas>=1.4,<2.0",
# deps for training
"matplotlib>=3.7.0",
# coqui stack
"trainer>=0.0.36",
# config management
"coqpit>=0.0.16",
# chinese g2p deps
"jieba",
"pypinyin",
# gruut+supported langs
"gruut[de,es,fr]==2.2.3",
# deps for korean
"hangul_romanize",
"jamo",
"nltk",
"g2pkk>=0.1.1",
# deps for bangla
"bangla",
"bnnumerizer",
"bnunicodenormalizer",
#deps for tortoise
"einops>=0.6.0",
"transformers>=4.33.0",
#deps for bark
"encodec>=0.1.1",
# deps for XTTS
"unidecode>=1.3.2",
"num2words",
"spacy[ja]>=3"
]

[build-system]
requires = [
"setuptools",
"setuptools<69.0.0",
"wheel",
"cython~=0.29.30",
"numpy>=1.22.0",
Expand All @@ -18,3 +80,4 @@ target-version = ['py39']
line_length = 120
profile = "black"
multi_line_output = 3

Loading

0 comments on commit 3515c24

Please sign in to comment.