Skip to content

Commit

Permalink
make cudnn optional, suppress transformers 4.48+ warning, update tran…
Browse files Browse the repository at this point in the history
…sformers to 4.49.0
  • Loading branch information
bigsk1 committed Feb 20, 2025
1 parent 11ffd2f commit d0d5b12
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ https://github.com/user-attachments/assets/5581bd53-422b-4a92-9b97-7ee4ea37e09b
Make sure you have ffmpeg downloaded, on windows terminal ( winget install ffmpeg ) or checkout https://ffmpeg.org/download.html then restart shell or vscode, type ffmpeg -version to see if installed correctly

Local XTTS you also might need cuDNN for using nvidia GPU https://developer.nvidia.com/cudnn and make sure C:\Program Files\NVIDIA\CUDNN\v9.5\bin\12.6
is in system PATH or whatever version you downloaded
is in system PATH or whatever version you downloaded, you can also disable cudnn in the XTTS-V2/config.json to "cudnn_enable": false, if you don't want to use it.

### Optional - Download Checkpoints - ONLY IF YOU ARE USING THE LOCAL XTTS

Expand Down Expand Up @@ -428,6 +428,10 @@ Invalid handle. Cannot load symbol cudnnCreateTensorDescriptor
```
To resolve this:

You can disable cudnn in the XTTS-V2/config.json and set to "cudnn_enable": false,

or

Install cuDNN: Download cuDNN from the NVIDIA cuDNN page https://developer.nvidia.com/cudnn

Here’s how to add it to the PATH:
Expand Down
7 changes: 5 additions & 2 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from pydub import AudioSegment
from .shared import clients

import logging
logging.getLogger("transformers").setLevel(logging.ERROR) # transformers 4.48+ warning

# Load environment variables
load_dotenv()
Expand Down Expand Up @@ -60,6 +62,9 @@
# Check for CUDA availability
device = "cuda" if torch.cuda.is_available() else "cpu"

# Disable CuDNN explicitly - enable this if you get cudnn errors or change in xtts-v2/config.json
# torch.backends.cudnn.enabled = False

# Default model size (adjust as needed)
model_size = "medium.en"

Expand Down Expand Up @@ -221,8 +226,6 @@ def sync_play_audio(file_path):

pass

# Model and device setup
# device = 'cuda' if torch.cuda.is_available() else 'cpu'
output_dir = os.path.join(project_dir, 'outputs')
os.makedirs(output_dir, exist_ok=True)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ soundfile==0.12.1
langid==1.1.6
librosa==0.10.0
scipy==1.11.4
transformers==4.41.2
transformers==4.49.0
pydantic==2.7.4
pillow==10.3.0

Expand Down
2 changes: 1 addition & 1 deletion requirements_no_xtts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ soundfile==0.12.1
langid==1.1.6
librosa==0.10.0
scipy==1.11.4
transformers==4.41.2
transformers==4.49.0
pydantic==2.7.4
pillow==10.3.0

Expand Down

0 comments on commit d0d5b12

Please sign in to comment.