gitmylo / audio-webui

A webui for different audio related Neural Networks
MIT License
1.01k stars 94 forks source link

[BUG REPORT] Does not install on Windows 10 or Docker on Windows 10 ( huggingface-hub incompatible version ) #236

Open unixman0x6576676C313531303933 opened 1 month ago

unixman0x6576676C313531303933 commented 1 month ago

Hello, sadly the installer does not work for me( Really want to try the project, but always get the same error... be it a fresh Docker install or a regular one

huggingface-hub>=0.23.2,<1.0 is required for a normal functioning of this module, but found huggingface-hub==0.23.0. Try: pip install transformers -U or pip install -e '.[dev]'

Which makes me wonder in circles, because when I install the correct version with `pip install transformers -U entering the virtual environment as the installer suggests via activate_only.bat , the next execution of run.bat installs huggingface-hub==0.23.0 and I am back at square one. I tried locking the required version of huggingface-hub, but i do not have any experience with python and this all is very new to me.

(venv) D:\audio-webui>pip install transformers -U Requirement already satisfied: transformers in d:\audio-webui\venv\lib\site-packages (4.42.4) Collecting huggingface-hub<1.0,>=0.23.2 Using cached huggingface_hub-0.23.4-py3-none-any.whl (402 kB) Requirement already satisfied: requests in d:\audio-webui\venv\lib\site-packages (from transformers) (2.32.3) Requirement already satisfied: packaging>=20.0 in d:\audio-webui\venv\lib\site-packages (from transformers) (24.1) Requirement already satisfied: pyyaml>=5.1 in d:\audio-webui\venv\lib\site-packages (from transformers) (6.0.1) Requirement already satisfied: tokenizers<0.20,>=0.19 in d:\audio-webui\venv\lib\site-packages (from transformers) (0.19.1) Requirement already satisfied: regex!=2019.12.17 in d:\audio-webui\venv\lib\site-packages (from transformers) (2024.5.15) Requirement already satisfied: safetensors>=0.4.1 in d:\audio-webui\venv\lib\site-packages (from transformers) (0.4.3) Requirement already satisfied: tqdm>=4.27 in d:\audio-webui\venv\lib\site-packages (from transformers) (4.66.4) Requirement already satisfied: numpy<2.0,>=1.17 in d:\audio-webui\venv\lib\site-packages (from transformers) (1.23.5) Requirement already satisfied: filelock in d:\audio-webui\venv\lib\site-packages (from transformers) (3.15.4) Requirement already satisfied: fsspec>=2023.5.0 in d:\audio-webui\venv\lib\site-packages (from huggingface-hub<1.0,>=0.23.2->transformers) (2024.6.1) Requirement already satisfied: typing-extensions>=3.7.4.3 in d:\audio-webui\venv\lib\site-packages (from huggingface-hub<1.0,>=0.23.2->transformers) (4.12.2) Requirement already satisfied: colorama in d:\audio-webui\venv\lib\site-packages (from tqdm>=4.27->transformers) (0.4.6) Requirement already satisfied: certifi>=2017.4.17 in d:\audio-webui\venv\lib\site-packages (from requests->transformers) (2024.7.4) Requirement already satisfied: urllib3<3,>=1.21.1 in d:\audio-webui\venv\lib\site-packages (from requests->transformers) (2.2.2) Requirement already satisfied: idna<4,>=2.5 in d:\audio-webui\venv\lib\site-packages (from requests->transformers) (3.7) Requirement already satisfied: charset-normalizer<4,>=2 in d:\audio-webui\venv\lib\site-packages (from requests->transformers) (3.3.2) Installing collected packages: huggingface-hub Attempting uninstall: huggingface-hub Found existing installation: huggingface-hub 0.23.0 Uninstalling huggingface-hub-0.23.0: Successfully uninstalled huggingface-hub-0.23.0 Successfully installed huggingface-hub-0.23.4

[notice] A new release of pip available: 22.2.1 -> 24.1.2 [notice] To update, run: python.exe -m pip install --upgrade pip

(venv) D:\audio-webui>main.py Checking installs and venv + autodebug checks Python version: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Webui version: 17c7489a1ffb1a95ac6e600af25383b7b07f3909 - Wed May 29 16:37:24 2024 +0200 Found extensions: Installed wheel! Installed huggingface-hub! Done installing/checking installs. Activating extensions Preparing Traceback (most recent call last): File "D:\audio-webui\main.py", line 27, in from webui.modules.implementations.tts_monkeypatching import patch as patch1 File "D:\audio-webui\webui\modules\implementations__init.py", line 1, in import webui.modules.implementations.ttsmodels as tts File "D:\audio-webui\webui\modules\implementations\ttsmodels.py", line 14, in import webui.modules.models as mod File "D:\audio-webui\webui\modules\models.py", line 6, in from transformers import Pipeline File "D:\audio-webui\venv\lib\site-packages\transformers\init__.py", line 26, in from . import dependency_versions_check File "D:\audio-webui\venv\lib\site-packages\transformers\dependency_versions_check.py", line 57, in require_version_core(deps[pkg]) File "D:\audio-webui\venv\lib\site-packages\transformers\utils\versions.py", line 117, in require_version_core return require_version(requirement, hint) File "D:\audio-webui\venv\lib\site-packages\transformers\utils\versions.py", line 111, in require_version _compare_versions(op, got_ver, want_ver, requirement, pkg, hint) File "D:\audio-webui\venv\lib\site-packages\transformers\utils\versions.py", line 44, in _compare_versions raise ImportError( ImportError: huggingface-hub>=0.23.2,<1.0 is required for a normal functioning of this module, but found huggingface-hub==0.23.0. Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main huggingface-hub>=0.23.2,<1.0 is required for a normal functioning of this module, but found huggingface-hub==0.23.0. Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main Your install might have failed to install one of the requirements, are you missing a package? You can read common issues at https://github.com/gitmylo/audio-webui/wiki/common-issues

Any help will be very appreciated

gitmylo commented 1 month ago

https://github.com/gitmylo/audio-webui/issues/231#issuecomment-2226785978 might be helpful for now. Until an actual fix is made.

unixman0x6576676C313531303933 commented 1 month ago

Thank you ! It worked, eventually...) Had to also resolve dependencies for torch and cuda.. Somehow after executing run.bat (even in a fresh venv and install) I always ended up with the wrong version of cuda for PyTorch, maybe it's a pip thing with it trying to resolve the dependencies.. but I don't really know. Also had problems with fairseq and audiocraft requiring conflicting dependencies. Namely fairseq 0.12.4 requires hydra-core<1.1,>=1.0.7, but after the install process I always winded up with hydra-core 1.3.2 and omegaconf 2.3.0. The workaround with fairseq was to first uninstall all that was conflicting and then:

pip install hydra-core==1.1 pip install audiocraft==1.3.0 pip install fairseq==0.12.2 --no-deps pip show hydra-core audiocraft fairseq

and then finally to satisfy all other fairseq dependencies using

pip install bitarray cffi cython numpy regex sacrebleu torch torchaudio tqdm

In the end I ended up with hydra-core 1.1 and omegaconf 2.1.2,

Tampa commented 4 weeks ago

pip install audiocraft==1.3.0

ERROR: Could not find a version that satisfies the requirement torch==2.1.0 (from audiocraft) (from versions: 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.1.0

Digging into that apparently audiocraft can't get their act together and provide a working version either. Trying to install their stable version gives a different error that is supposedly down to requirement for python 3.9, which doesn't actually solve the issue either. I have most 3.x versions installed, no dice. The errors setuptools spits out speak volumes about the code quality on their end as well.

At some point it becomes a question of freezing dependencies or outright shipping them as stale versions instead of trying to rely on others to provide stable releases to depend on. :/

Tampa commented 3 weeks ago

@gitmylo

Temporarily:

+import subprocess
+import sys

+def install(package):
+    subprocess.check_call([sys.executable, "-m", "pip", "install", package])

    for e in em.states.values():
        e.activate()

+    install('huggingface-hub==0.23.2')

    print('Preparing')

Can also add:

install('--no-cache-dir torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --extra-index-url https://download.pytorch.org/whl/cu118')

In the cases where that doesn't install properly for some reason I guess.

Also, it hates spaces or special chars in folder names, so don't do "New Folder" or "$git" as folder names... yeah I should know better on that.