mirror of
https://github.com/remsky/Kokoro-FastAPI.git
synced 2025-08-05 16:48:53 +00:00
Update Dockerfile and docker-compose.yml to add versions, specify Kokoro commit
This commit is contained in:
parent
aa2df45858
commit
ae6f49c7e1
4 changed files with 38 additions and 9 deletions
24
Dockerfile
24
Dockerfile
|
@ -1,6 +1,7 @@
|
||||||
FROM nvidia/cuda:12.1.0-base-ubuntu22.04
|
FROM nvidia/cuda:12.1.0-base-ubuntu22.04
|
||||||
|
|
||||||
ARG KOKORO_REPO
|
ARG KOKORO_REPO
|
||||||
|
ARG KOKORO_COMMIT
|
||||||
|
|
||||||
# Install base system dependencies
|
# Install base system dependencies
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
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)
|
# Install heavy Python dependencies first (better layer caching)
|
||||||
RUN pip3 install --no-cache-dir \
|
RUN pip3 install --no-cache-dir \
|
||||||
phonemizer \
|
phonemizer==3.3.0 \
|
||||||
torch \
|
torch==2.5.1 \
|
||||||
transformers \
|
transformers==4.47.1 \
|
||||||
scipy \
|
scipy==1.14.1 \
|
||||||
munch
|
numpy==2.2.1 \
|
||||||
|
munch==4.0.0
|
||||||
|
|
||||||
# Install API dependencies
|
# 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
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
@ -32,8 +39,9 @@ RUN apt-get update && apt-get install -y git-lfs \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& git lfs install
|
&& git lfs install
|
||||||
|
|
||||||
# Clone Kokoro repo
|
# Clone Kokoro repo at specific commit
|
||||||
RUN git clone ${KOKORO_REPO} .
|
RUN git clone ${KOKORO_REPO} . && \
|
||||||
|
git checkout ${KOKORO_COMMIT}
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
# Create output directory
|
# Create output directory
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# Kokoro TTS API
|
# Kokoro TTS API
|
||||||
[](https://huggingface.co/hexgrad/Kokoro-82M/tree/a67f11354c3e38c58c3327498bc4bd1e57e71c50)
|
[](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
|
Dockerized with NVIDIA GPU support, simple queue handling via sqllite, and automatic chunking/stitching on lengthy input/outputs
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ services:
|
||||||
context: .
|
context: .
|
||||||
args:
|
args:
|
||||||
- KOKORO_REPO=https://huggingface.co/hexgrad/Kokoro-82M
|
- KOKORO_REPO=https://huggingface.co/hexgrad/Kokoro-82M
|
||||||
|
- KOKORO_COMMIT=a67f11354c3e38c58c3327498bc4bd1e57e71c50
|
||||||
volumes:
|
volumes:
|
||||||
- ./api:/app/api
|
- ./api:/app/api
|
||||||
ports:
|
ports:
|
||||||
|
|
20
requirements.txt
Normal file
20
requirements.txt
Normal 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
|
Loading…
Add table
Reference in a new issue