2024-12-31 04:51:21 -07:00
|
|
|
services:
|
|
|
|
model-fetcher:
|
|
|
|
image: datamachines/git-lfs:latest
|
|
|
|
volumes:
|
|
|
|
- ./Kokoro-82M:/app/Kokoro-82M
|
|
|
|
working_dir: /app/Kokoro-82M
|
|
|
|
command: >
|
|
|
|
sh -c "
|
2025-01-01 17:38:22 -07:00
|
|
|
rm -f .git/index.lock;
|
2024-12-31 04:51:21 -07:00
|
|
|
if [ -z \"$(ls -A .)\" ]; then
|
2025-01-02 01:59:25 -07:00
|
|
|
git clone https://huggingface.co/hexgrad/Kokoro-82M .
|
2024-12-31 04:51:21 -07:00
|
|
|
touch .cloned;
|
|
|
|
else
|
2025-01-01 17:38:22 -07:00
|
|
|
rm -f .git/index.lock && \
|
|
|
|
git checkout main && \
|
|
|
|
git pull origin main && \
|
2024-12-31 04:51:21 -07:00
|
|
|
touch .cloned;
|
|
|
|
fi;
|
|
|
|
tail -f /dev/null
|
|
|
|
"
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "test", "-f", ".cloned"]
|
2025-01-02 01:59:25 -07:00
|
|
|
interval: 5s
|
|
|
|
timeout: 2s
|
|
|
|
retries: 300
|
2024-12-31 04:51:21 -07:00
|
|
|
start_period: 1s
|
|
|
|
|
|
|
|
kokoro-tts:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile.cpu
|
|
|
|
volumes:
|
|
|
|
- ./api/src:/app/api/src
|
|
|
|
- ./Kokoro-82M:/app/Kokoro-82M
|
|
|
|
ports:
|
|
|
|
- "8880:8880"
|
|
|
|
environment:
|
|
|
|
- PYTHONPATH=/app:/app/Kokoro-82M
|
2025-01-04 02:14:46 -07:00
|
|
|
# ONNX Optimization Settings for vectorized operations
|
|
|
|
- ONNX_NUM_THREADS=8 # Maximize core usage for vectorized ops
|
|
|
|
- ONNX_INTER_OP_THREADS=4 # Higher inter-op for parallel matrix operations
|
|
|
|
- ONNX_EXECUTION_MODE=parallel
|
|
|
|
- ONNX_OPTIMIZATION_LEVEL=all
|
|
|
|
- ONNX_MEMORY_PATTERN=true
|
|
|
|
- ONNX_ARENA_EXTEND_STRATEGY=kNextPowerOfTwo
|
2025-01-06 03:32:41 -07:00
|
|
|
|
2024-12-31 04:51:21 -07:00
|
|
|
depends_on:
|
|
|
|
model-fetcher:
|
|
|
|
condition: service_healthy
|
2025-01-02 01:59:25 -07:00
|
|
|
|
2025-01-04 02:46:27 -07:00
|
|
|
# Gradio UI service [Comment out everything below if you don't need it]
|
|
|
|
gradio-ui:
|
|
|
|
build:
|
|
|
|
context: ./ui
|
|
|
|
ports:
|
|
|
|
- "7860:7860"
|
|
|
|
volumes:
|
|
|
|
- ./ui/data:/app/ui/data
|
|
|
|
- ./ui/app.py:/app/app.py # Mount app.py for hot reload
|
|
|
|
environment:
|
|
|
|
- GRADIO_WATCH=True # Enable hot reloading
|