diff --git a/tutorials/indic/tts/README.md b/tutorials/indic/tts/README.md index a264899..117d3e4 100644 --- a/tutorials/indic/tts/README.md +++ b/tutorials/indic/tts/README.md @@ -1,8 +1,17 @@ TTS - +- Download model from Huggingface + - huggingface-cli download ai4bharat/indic-parler-tts - Run with Docker compose - - + - docker compose -f indic-tts-compose.yml up --detach parler-tts-server + +- Test output + - curl -s -H "content-type: application/json" localhost:8000/v1/audio/speech -d '{"input": "Hey, how are you?"}' -o audio.mp3 + + +--- +TODO - Create docker image - docker build -t indic-parler-tts . @@ -10,3 +19,16 @@ TTS - - Run the container - docker run -d -p 8000:8000 -v ~/.cache/huggingface:/root/.cache/huggingface parler-tts + + +- huggingface-cli download parler-tts/parler-tts-mini-expresso + +- with fedirz/parler-tts + - ai4bharat/indic-parler-tts + - huggingface-cli download ai4bharat/indic-parler-tts + - docker run --detach --volume ~/.cache/huggingface:/root/.cache/huggingface --publish 8000:8000 --env MODEL="ai4bharat/indic-parler-tts" fedirz/parler-tts-server + - parler-tts/parler-tts-mini-expresso + - huggingface-cli download parler-tts/parler-tts-mini-expresso + - docker run --detach --volume ~/.cache/huggingface:/root/.cache/huggingface --publish 8000:8000 --env MODEL="parler-tts/parler-tts-mini-expresso" fedirz/parler-tts-server + +- curl -s -H "content-type: application/json" localhost:8000/v1/audio/speech -d '{"input": "Hey, how are you?"}' -o audio.mp3 diff --git a/tutorials/indic/tts/indic-tts-compose.yml b/tutorials/indic/tts/indic-tts-compose.yml index 229cfda..cfc50c0 100644 --- a/tutorials/indic/tts/indic-tts-compose.yml +++ b/tutorials/indic/tts/indic-tts-compose.yml @@ -1,15 +1,30 @@ services: - parler-tts: - build: . - image: pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime - ports: - - "8000:8000" + parler-tts-server: + image: fedirz/parler-tts-server + build: + dockerfile: Dockerfile + context: . + platforms: + - linux/amd64 + tags: + - fedirz/parler-tts-server + develop: + watch: + - path: ./parler_tts_server + action: rebuild volumes: - ~/.cache/huggingface:/root/.cache/huggingface + restart: unless-stopped + ports: + - 8000:8000 environment: - - TZ=UTC - - MODEL_NAME=ai4bharat/indic-parler-tts - - PYTHONUNBUFFERED=1 + - MODEL=ai4bharat/indic-parler-tts + healthcheck: + test: curl --fail http://0.0.0.0:8000/health || exit 1 + interval: 10s + timeout: 10s + retries: 3 + start_period: 15s deploy: resources: reservations: @@ -17,12 +32,3 @@ services: - driver: nvidia device_ids: ['0'] capabilities: [gpu] - restart: unless-stopped - healthcheck: - test: ["CMD", "nvidia-smi"] - interval: 30s - timeout: 10s - retries: 3 - -volumes: - huggingface_cache: diff --git a/tutorials/indic/tts/test-compose.yml b/tutorials/indic/tts/test-compose.yml new file mode 100644 index 0000000..229cfda --- /dev/null +++ b/tutorials/indic/tts/test-compose.yml @@ -0,0 +1,28 @@ +services: + parler-tts: + build: . + image: pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime + ports: + - "8000:8000" + volumes: + - ~/.cache/huggingface:/root/.cache/huggingface + environment: + - TZ=UTC + - MODEL_NAME=ai4bharat/indic-parler-tts + - PYTHONUNBUFFERED=1 + deploy: + resources: + reservations: + devices: + - driver: nvidia + device_ids: ['0'] + capabilities: [gpu] + restart: unless-stopped + healthcheck: + test: ["CMD", "nvidia-smi"] + interval: 30s + timeout: 10s + retries: 3 + +volumes: + huggingface_cache: