NON906 / chara-searcher

This is a repository for "character images search" from image and tags.
Other
23 stars 1 forks source link

ImportError: cannot import name 'cached_download' from 'huggingface_hub' #5

Closed BrianStark closed 2 weeks ago

BrianStark commented 2 weeks ago

ImportError: cannot import name 'cached_download' from 'huggingface_hub'

Today I got this error in my console, and Chara-Searcher doesn't show up anymore. Is there a way to fix this??

*** Error loading script: main.py
    Traceback (most recent call last):
      File "D:\AI\stable-diffusion-webui\stable-diffusion-webui\modules\scripts.py", line 515, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "D:\AI\stable-diffusion-webui\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "D:\AI\stable-diffusion-webui\stable-diffusion-webui\extensions\chara-searcher\scripts\main.py", line 5, in <module>
        from standalone_ui import main_ui
      File "D:\AI\stable-diffusion-webui\stable-diffusion-webui\extensions\chara-searcher\standalone_ui.py", line 10, in <module>
        from sentence_transformers import SentenceTransformer
      File "D:\AI\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\sentence_transformers\__init__.py", line 3, in <module>
        from .datasets import SentencesDataset, ParallelSentencesDataset
      File "D:\AI\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\sentence_transformers\datasets\__init__.py", line 3, in <module>
        from .ParallelSentencesDataset import ParallelSentencesDataset
      File "D:\AI\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\sentence_transformers\datasets\ParallelSentencesDataset.py", line 4, in <module>
        from .. import SentenceTransformer
      File "D:\AI\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\sentence_transformers\SentenceTransformer.py", line 12, in <module>
        from huggingface_hub import HfApi, HfFolder, Repository, hf_hub_url, cached_download
    ImportError: cannot import name 'cached_download' from 'huggingface_hub' (D:\AI\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\__init__.py)

---
NON906 commented 2 weeks ago

I fixed with 21881b3e3ab2925a2738d106799951f59ad67537. Please check it.

This seems to be an error caused by the removal of cached_download() in the latest version of huggingface-hub.

BrianStark commented 2 weeks ago

yesss it works 100% again, good job man