gitmylo / audio-webui

A webui for different audio related Neural Networks
MIT License
964 stars 90 forks source link

[BUG REPORT] AttributeError: module 'huggingface_hub.constants' has no attribute 'HF_HUB_CACHE' #192

Closed luthis1124 closed 6 months ago

luthis1124 commented 6 months ago

. run.sh Checking installs and venv + autodebug checks Python version: 3.10.13 (main, Dec 16 2023, 08:01:00) [GCC 13.2.1 20230801] Webui version: a1152eda3d45f83f338522206ace32db7ec694f4 - Fri Dec 15 17:21:03 2023 +0100 Found extensions: Done installing/checking installs. Activating extensions Preparing Traceback (most recent call last): File "/home/st/GIT/audio-webui/main.py", line 45, in autodebug.catcher(e) File "/home/st/GIT/audio-webui/autodebug/autodebug.py", line 79, in catcher raise e File "/home/st/GIT/audio-webui/main.py", line 27, in from webui.modules.implementations.tts_monkeypatching import patch as patch1 File "/home/st/GIT/audio-webui/webui/modules/implementations/init.py", line 1, in import webui.modules.implementations.ttsmodels as tts File "/home/st/GIT/audio-webui/webui/modules/implementations/ttsmodels.py", line 14, in import webui.modules.models as mod File "/home/st/GIT/audio-webui/webui/modules/models.py", line 6, in from transformers import Pipeline File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/transformers/init.py", line 26, in from . import dependency_versions_check File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/transformers/dependency_versions_check.py", line 16, in from .utils.versions import require_version, require_version_core File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/transformers/utils/init.py", line 61, in from .hub import ( File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/transformers/utils/hub.py", line 94, in PYTORCH_PRETRAINED_BERT_CACHE = os.getenv("PYTORCH_PRETRAINED_BERT_CACHE", constants.HF_HUB_CACHE) AttributeError: module 'huggingface_hub.constants' has no attribute 'HF_HUB_CACHE' Press any key to exit...1(audio-webui) [st@luthis audio-webui]$

Haven't had a chance to investigate this one yet. I fixed the first issue by manually installing pyworld 0.3.2, webui then ran, started downloading barktts models, but it stopped on one. I closed and re-ran, but had the above issue

To create a public link, set share=True in launch(). text_2.pt: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5.35G/5.35G [06:44<00:00, 13.2MB/s] tokenizer_config.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 29.0/29.0 [00:00<00:00, 200kB/s] vocab.txt: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 996k/996k [00:00<00:00, 1.23MB/s] tokenizer.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.96M/1.96M [00:00<00:00, 1.96MB/s] config.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 625/625 [00:00<00:00, 4.30MB/s] coarse_2.pt: 60%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 2.35G/3.93G [02:56<01:59, 13.3MB/s] Traceback (most recent call last): File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/gradio/routes.py", line 437, in run_predict output = await app.get_blocks().process_api( File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/gradio/blocks.py", line 1352, in process_api result = await self.call_function( File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/gradio/blocks.py", line 1077, in call_function prediction = await anyio.to_thread.run_sync( File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, args) File "/home/st/GIT/audio-webui/webui/ui/tabs/text_to_speech.py", line 52, in load_model loader.load_model(progress) File "/home/st/GIT/audio-webui/webui/modules/implementations/ttsmodels.py", line 246, in load_model preload_models_new( File "/home/st/GIT/audio-webui/webui/modules/implementations/patches/bark_generation.py", line 673, in preload_modelsnew = load_model( File "/home/st/GIT/audio-webui/webui/modules/implementations/patches/bark_generation.py", line 625, in load_model model = _load_model_f(ckpt_path, device) File "/home/st/GIT/audio-webui/webui/modules/implementations/patches/bark_generation.py", line 563, in _load_model o._download(model_info["repo_id"], model_info["file_name"]) File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/bark/generation.py", line 151, in _download hf_hub_download(repo_id=from_hf_path, filename=file_name, local_dir=CACHE_DIR) File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(args, **kwargs) File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1461, in hf_hub_download http_get( File "/home/st/GIT/audio-webui/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 569, in http_get raise EnvironmentError( OSError: Consistency check failed: file should be of size 3934534533 but has size 2350559280 (coarse_2.pt). We are sorry for the inconvenience. Please retry download and pass force_download=True, resume_download=False as argument. If the issue persists, please let us know by opening an issue on https://github.com/huggingface/huggingface_hub.

luthis1124 commented 6 months ago

Well, it's not wrong...

grep -c HF_HUB audio-webui/lib/python3.10/site-packages/huggingface_hub/constants.py 11

grep -c HF_HUB_CACHE audio-webui/lib/python3.10/site-packages/huggingface_hub/constants.py 0

What version of huggingface_hub should we be using?

luthis1124 commented 6 months ago

I just added

HF_HUB_CACHE = None

to the hugginface constants file, and now getting:

AttributeError: module 'huggingface_hub.constants' has no attribute 'HF_HOME'

So... seems we need to verify the version. Auto-installed was:

huggingface_hub-0.17.1

luthis1124 commented 6 months ago

env vars exist in version 0.19.4, will try installing that

luthis1124 commented 6 months ago

Ok so when I start webui again, it overwrites the installed correct version with 0.17.1:

Successfully installed huggingface_hub-0.19.4

. run.sh Checking installs and venv + autodebug checks Python version: 3.10.13 (main, Dec 16 2023, 08:01:00) [GCC 13.2.1 20230801] Webui version: a1152eda3d45f83f338522206ace32db7ec694f4 - Fri Dec 15 17:21:03 2023 +0100 Found extensions: Installed huggingface-hub!

luthis1124 commented 6 months ago

Not sure what is installing the wrong version of huggingface hub, it's not specified in the requirements.txt

I tried grepping but couldn't find version specified in plaintext, just binary file matches.

luthis1124 commented 6 months ago

I think we can avoid a lot of these bugs by hard-coding versions in the requirements, so it's a guaranteed stable version, and test new versions of libraries before changing the version in requirements.

gitmylo commented 6 months ago

It was hard coded, to the older version. So I guess something else updated which caused an error that looks like it's completely in huggingface_hub, although it can't have been.

luthis1124 commented 6 months ago

Wierd...

Oh well, its fixed now!