Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix device=CPU usage if cuda is not available + improve code formating. #21

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ cython_debug/
#.idea/

base_models
finetune_models
finetune_models
/test_model
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common curl && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python3.10 && \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10

# Copy the requirements.txt file to the container
COPY requirements.txt /root/

# Install the packages from requirements.txt
RUN pip install --no-cache-dir -r /root/requirements.txt

ENV GRADIO_SERVER_NAME=0.0.0.0

WORKDIR /root/tts

CMD ["/usr/bin/python3", "xtts_demo.py"]
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.8'
services:
tts_service:
build: .
image: tts_image
container_name: tts_container
command: ["/usr/bin/python3", "xtts_demo.py"]
volumes:
- .:/root/tts
- .cache:/root/.cache/huggingface # hugging face cache
ports:
- "5003:5003" # Map ports if your application uses them
#device_requests: # for futur docker version
# - driver: nvidia
# count: all
# capabilities: [gpu]
stdin_open: true
tty: true
runtime: nvidia
deploy:
resources:
reservations:
devices:
- driver: nvidia
# device_ids: ['0', '3']
capabilities: [gpu]

# docker exec -it tts_container /bin/bash
2 changes: 1 addition & 1 deletion install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
python -m venv venv
call venv/scripts/activate

pip install torch==2.1.1+cu118 torchaudio==2.1.1+cu118 --index-url https://download.pytorch.org/whl/cu118
pip install -r .\requirements.txt
pip install torch==2.1.1+cu118 torchaudio==2.1.1+cu118 --index-url https://download.pytorch.org/whl/cu118

python xtts_demo.py
9 changes: 9 additions & 0 deletions install.mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

python -m venv venv
source ./venv/bin/activate

pip install -r requirements.txt
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1

python xtts_demo.py
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tool.black]
line-length = 100

[tool.isort]
profile = "black"
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
faster_whisper==0.10.0
gradio==4.9.1
tts == 0.22.0
faster_whisper==1.0.2
gradio==4.13.0
spacy==3.7.4
coqui-tts[languages] == 0.24.1

cutlet
fugashi[unidic-lite]
Loading