JarodMica / StyleTTS-WebUI

MIT License
52 stars 18 forks source link

Change the order of torch installation #30

Closed code-switched closed 2 months ago

code-switched commented 2 months ago

Am I following this correctly?

PS C:\Users\USER> cd C:\code\tts
PS C:\code\tts> git clone https://github.com/JarodMica/StyleTTS-WebUI.git
Cloning into 'StyleTTS-WebUI'...
remote: Enumerating objects: 173, done.
remote: Counting objects: 100% (41/41), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 173 (delta 40), reused 39 (delta 39), pack-reused 132 (from 1)
Receiving objects: 100% (173/173), 133.23 MiB | 63.10 MiB/s, done.
Resolving deltas: 100% (82/82), done.
PS C:\code\tts> cd .\StyleTTS-WebUI\
PS C:\code\tts\StyleTTS-WebUI> py -3.11 -m venv venv
PS C:\code\tts\StyleTTS-WebUI> .\venv\Scripts\activate
(venv) PS C:\code\tts\StyleTTS-WebUI> pip install -r requirements.txt
Collecting git+https://github.com/m-bain/whisperx.git@58f00339af7dcc9705ef49d97a1f40764b7cf555 (from -r requirements.txt (line 21))
  Cloning https://github.com/m-bain/whisperx.git (to revision 58f00339af7dcc9705ef49d97a1f40764b7cf555) to C:\Users\USER\appdata\local\temp\pip-req-build-yvwwdd7s
  Running command git clone --filter=blob:none --quiet https://github.com/m-bain/whisperx.git 'C:\Users\USER\AppData\Local\Temp\pip-req-build-yvwwdd7s'
  Running command git rev-parse -q --verify 'sha^58f00339af7dcc9705ef49d97a1f40764b7cf555'
  Running command git fetch -q https://github.com/m-bain/whisperx.git 58f00339af7dcc9705ef49d97a1f40764b7cf555
  Running command git checkout -q 58f00339af7dcc9705ef49d97a1f40764b7cf555
  Resolved https://github.com/m-bain/whisperx.git to commit 58f00339af7dcc9705ef49d97a1f40764b7cf555
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting git+https://github.com/resemble-ai/monotonic_align.git@78b985be210a03d08bc3acc01c4df0442105366f (from -r requirements.txt (line 22))
  Cloning https://github.com/resemble-ai/monotonic_align.git (to revision 78b985be210a03d08bc3acc01c4df0442105366f) to C:\Users\USER\appdata\local\temp\pip-req-build-hqam6xnh
  Running command git clone --filter=blob:none --quiet https://github.com/resemble-ai/monotonic_align.git 'C:\Users\USER\AppData\Local\Temp\pip-req-build-hqam6xnh'
  Running command git rev-parse -q --verify 'sha^78b985be210a03d08bc3acc01c4df0442105366f'
  Running command git fetch -q https://github.com/resemble-ai/monotonic_align.git 78b985be210a03d08bc3acc01c4df0442105366f
  Resolved https://github.com/resemble-ai/monotonic_align.git to commit 78b985be210a03d08bc3acc01c4df0442105366f
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting SoundFile==0.12.1 (from -r requirements.txt (line 1))
  Using cached soundfile-0.12.1-py2.py3-none-win_amd64.whl.metadata (14 kB)
Collecting munch==4.0.0 (from -r requirements.txt (line 2))
  Downloading munch-4.0.0-py2.py3-none-any.whl.metadata (5.9 kB)
ERROR: Could not find a version that satisfies the requirement torch==2.3.1+cu121 (from versions: 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0)
ERROR: No matching distribution found for torch==2.3.1+cu121

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: python.exe -m pip install --upgrade pip
(venv) PS C:\code\tts\StyleTTS-WebUI>

The install command never makes it past munch the 3rd package out of 21 Maybe we should run the pytorch command first then uninstall + reinstall again after requirements.txt just to be sure?

JarodMica commented 2 months ago

Can you change the line in requirements.txt to:

torch==2.3.1+cu121

To:

torch

And rerun to see if it works?

code-switched commented 2 months ago

Can you change the line in requirements.txt to:

torch==2.3.1+cu121

To:

torch

And rerun to see if it works?

I think this would resolve it. I manually ran the full torch command before pip install -r requirements.txt and it worked. I'll post another comment with the full commands. I actually want to set TTS up on a different machine so I'll give this requirements.txt change a test in a bit.

code-switched commented 2 months ago

This set of commands worked for me:

git clone https://github.com/JarodMica/StyleTTS-WebUI.git
cd .\StyleTTS-WebUI\
py -3.11 -m venv venv
.\venv\Scripts\activate
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt

git submodule init
git submodule update --remote
pip install .\modules\StyleTTS2\

curl.exe -L -o "models\pretrain_base_1\epochs_2nd_00020.pth" "https://huggingface.co/yl4579/StyleTTS2-LibriTTS/resolve/main/Models/LibriTTS/epochs_2nd_00020.pth"
curl.exe -L -o "models\pretrain_base_1\config.yml" "https://huggingface.co/yl4579/StyleTTS2-LibriTTS/resolve/main/Models/LibriTTS/config.yml"

[System.Environment]::SetEnvironmentVariable("PHONEMIZER_ESPEAK_LIBRARY", "C:\Program Files\eSpeak NG\libespeak-ng.dll", "Machine")
[System.Environment]::SetEnvironmentVariable("PHONEMIZER_ESPEAK_PATH", "C:\Program Files\eSpeak NG", "Machine")

python .\modules\StyleTTS2\styletts2\download_punkt.py

python webui.py
JarodMica commented 2 months ago

Awesome, well, looks good then, thanks! I'll get around to updating requirements and install instructions then sometime soon

JarodMica commented 2 months ago

Resolved: https://github.com/JarodMica/StyleTTS-WebUI/commit/21e57e8b683b1f16c2d1c825f52abb87bd52637d