Update Dockerfile and docker-compose.yml to add versions, specify Kokoro commit

This commit is contained in:
remsky 2024-12-30 05:29:35 -07:00
parent aa2df45858
commit ae6f49c7e1
4 changed files with 38 additions and 9 deletions

View file

@ -1,6 +1,7 @@
FROM nvidia/cuda:12.1.0-base-ubuntu22.04
ARG KOKORO_REPO
ARG KOKORO_COMMIT
# Install base system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
@ -13,14 +14,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Install heavy Python dependencies first (better layer caching)
RUN pip3 install --no-cache-dir \
phonemizer \
torch \
transformers \
scipy \
munch
phonemizer==3.3.0 \
torch==2.5.1 \
transformers==4.47.1 \
scipy==1.14.1 \
numpy==2.2.1 \
munch==4.0.0
# Install API dependencies
RUN pip3 install --no-cache-dir fastapi uvicorn pydantic-settings
RUN pip3 install --no-cache-dir \
fastapi==0.115.6 \
uvicorn==0.34.0 \
pydantic==2.10.4 \
pydantic-settings==2.7.0 \
python-dotenv==1.0.1
# Set working directory
WORKDIR /app
@ -32,8 +39,9 @@ RUN apt-get update && apt-get install -y git-lfs \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install
# Clone Kokoro repo
RUN git clone ${KOKORO_REPO} .
# Clone Kokoro repo at specific commit
RUN git clone ${KOKORO_REPO} . && \
git checkout ${KOKORO_COMMIT}
# --------------------------------------
# Create output directory

View file

@ -5,7 +5,7 @@
# Kokoro TTS API
[![Model Commit](https://img.shields.io/badge/model--commit-a67f113-blue)](https://huggingface.co/hexgrad/Kokoro-82M/tree/a67f11354c3e38c58c3327498bc4bd1e57e71c50)
FastAPI wrapper for [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) text-to-speech model with voice cloning capabilities.
FastAPI wrapper for [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) text-to-speech model.
Dockerized with NVIDIA GPU support, simple queue handling via sqllite, and automatic chunking/stitching on lengthy input/outputs

View file

@ -4,6 +4,7 @@ services:
context: .
args:
- KOKORO_REPO=https://huggingface.co/hexgrad/Kokoro-82M
- KOKORO_COMMIT=a67f11354c3e38c58c3327498bc4bd1e57e71c50
volumes:
- ./api:/app/api
ports:

20
requirements.txt Normal file
View file

@ -0,0 +1,20 @@
# Core dependencies
fastapi==0.115.6
uvicorn==0.34.0
pydantic==2.10.4
python-dotenv==1.0.1
# ML/DL
torch==2.5.1
transformers==4.47.1
numpy==2.2.1
scipy==1.14.1
# Text processing
phonemizer==3.3.0
regex==2024.11.6
# Utilities
tqdm==4.67.1
requests==2.32.3
munch==4.0.0