Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'cached_download' from 'huggingface_hub #237

Open
eniiaflannery opened this issue Nov 12, 2024 · 11 comments
Open

'cached_download' from 'huggingface_hub #237

eniiaflannery opened this issue Nov 12, 2024 · 11 comments

Comments

@eniiaflannery
Copy link

"/content/kohya-trainer/train_network_xl_wrapper.py", line 2, in
from sdxl_train_network import setup_parser, SdxlNetworkTrainer
File "/content/kohya-trainer/sdxl_train_network.py", line 3, in
from library import sdxl_model_util, sdxl_train_util, train_util
File "/content/kohya-trainer/library/sdxl_model_util.py", line 7, in
from diffusers import AutoencoderKL, EulerDiscreteScheduler, UNet2DConditionModel
File "/usr/local/lib/python3.10/dist-packages/diffusers/init.py", line 3, in
from .configuration_utils import ConfigMixin
File "/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py", line 34, in
from .utils import (
File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/init.py", line 38, in
from .dynamic_modules_utils import get_class_from_dynamic_module
File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/dynamic_modules_utils.py", line 28, in
from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info

ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/usr/local/lib/python3.10/dist-packages/huggingface_hub/init.py)

@re3me
Copy link

re3me commented Nov 12, 2024

same error here. tried disabling diffusers didnt help. cant access python file to block out cache download

@gwhitez
Copy link

gwhitez commented Nov 12, 2024

Here is a temporary solution: change huggingface_hub to huggingface_hub==0.22.0, when you reach a certain point it will ask you to restart the session, after that run the training cell again, then it should start training.

image

@AIuser0101
Copy link

where in the code does it say "huggingface_hub"?
I did a ctrl+f and pasted it in, the only instance I found was the:

from huggingface_hub import HfFileSystem

@gwhitez
Copy link

gwhitez commented Nov 12, 2024

where in the code does it say "huggingface_hub"? I did a ctrl+f and pasted it in, the only instance I found was the:

from huggingface_hub import HfFileSystem

press control + H and search for
huggingface-hub then just change it to
huggingface-hub==0.22.0

@AIuser0101
Copy link

Thanks! This got past that error message, and it prompted me restart the session, I did that, but then now I'm getting this one:
(just using a checkpoint in my google drive)

Traceback (most recent call last):
File "/content/kohya-trainer/train_network_xl_wrapper.py", line 10, in
trainer.train(args)
File "/content/kohya-trainer/train_network.py", line 213, in train
model_version, text_encoder, vae, unet = self.load_target_model(args, weight_dtype, accelerator)
File "/content/kohya-trainer/sdxl_train_network.py", line 34, in load_target_model
) = sdxl_train_util.load_target_model(args, accelerator, sdxl_model_util.MODEL_VERSION_SDXL_BASE_V0_9, weight_dtype)
File "/content/kohya-trainer/library/sdxl_train_util.py", line 33, in load_target_model
) = _load_target_model(
File "/content/kohya-trainer/library/sdxl_train_util.py", line 70, in _load_target_model
) = sdxl_model_util.load_models_from_sdxl_checkpoint(model_version, name_or_path, device, weight_dtype)
File "/content/kohya-trainer/library/sdxl_model_util.py", line 260, in load_models_from_sdxl_checkpoint
info1 = text_model1.load_state_dict(te1_sd)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 2584, in load_state_dict
raise RuntimeError(

RuntimeError: Error(s) in loading state_dict for CLIPTextModel:
Missing key(s) in state_dict: "text_model.embeddings.position_ids".

@JayarCurio
Copy link

JayarCurio commented Nov 13, 2024

Edit: No wait. The linked version is working, now. I wish I knew why.
Original:
That just gives me the same error as writing it in manually.

File "", line 6
from huggingface_hub==0.22.0 import HfFileSystem
^
SyntaxError: invalid syntax

@Jamper333
Copy link

Hi

!pip install huggingface_hub==0.22.0

@AIuser0101
Copy link

I get this error when I do that:
ImportError: huggingface-hub>=0.23.2,<1.0 is required for a normal functioning of this module, but found huggingface-hub==0.22.0.
Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main

@AIuser0101
Copy link

never mind, i opened up a fresh notebook and I'm getting this error now:

Traceback (most recent call last):
File "/content/kohya-trainer/train_network_xl_wrapper.py", line 2, in
from sdxl_train_network import setup_parser, SdxlNetworkTrainer
File "/content/kohya-trainer/sdxl_train_network.py", line 4, in
import train_network
File "/content/kohya-trainer/train_network.py", line 23, in
import library.config_util as config_util
File "/content/kohya-trainer/library/config_util.py", line 21, in
import voluptuous

ModuleNotFoundError: No module named 'voluptuous'

==
This is using a custom model checkpoint.
Thanks,

@hollowstrawberry
Copy link
Owner

That's strange, I already set the huggingface-hub version to 0.22.0 days ago and voluptuous is present too. I don't know why only some people get these errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@JayarCurio @hollowstrawberry @re3me @eniiaflannery @gwhitez @AIuser0101 @Jamper333 and others