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

Error using cache_dir in from_pretrained since update #1398

Closed
Skquark opened this issue Mar 19, 2023 · 2 comments · Fixed by #1399
Closed

Error using cache_dir in from_pretrained since update #1398

Skquark opened this issue Mar 19, 2023 · 2 comments · Fixed by #1399

Comments

@Skquark
Copy link

Skquark commented Mar 19, 2023

While using Diffusers with an absolute path set in cache_dir, I'm suddenly getting an error "[Errno 95] Operation not supported" when loading any model from_pretrained with all the pipelines. Was working fine a week ago, happened since this commit cdaa410 by @Wauplin and would like to be able to use cache again. Here's the error:

  File "<ipython-input-7-cc85556e36ff>", line 8965, in get_lpw_pipe
    pipe = DiffusionPipeline.from_pretrained(model_path, custom_pipeline="AlanB/lpw_stable_diffusion_mod", cache_dir=prefs['cache_dir'] if bool(prefs['cache_dir']) else None, torch_dtype=torch.float16, safety_checker=None if prefs['disable_nsfw_filter'] else StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker").to(torch_device), requires_safety_checker=not prefs['disable_nsfw_filter'])
  File "/usr/local/lib/python3.9/dist-packages/diffusers/pipelines/pipeline_utils.py", line 764, in from_pretrained
    cached_folder = cls.download(
  File "/usr/local/lib/python3.9/dist-packages/diffusers/pipelines/pipeline_utils.py", line 1093, in download
    config_file = hf_hub_download(
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 1256, in hf_hub_download
    _create_symlink(blob_path, pointer_path, new_blob=False)
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 857, in _create_symlink
    os.symlink(abs_src, abs_dst)
OSError: [Errno 95] Operation not supported: '/content/drive/MyDrive/AI/Stable_Diffusion/models/models--prompthero--openjourney/blobs/ec7e89e526405bf51ca1f538c8d48e76fd3e8f27' -> '/content/drive/MyDrive/AI/Stable_Diffusion/models/models--prompthero--openjourney/snapshots/bf2f700a1623c5d0de5197ae6267e96db9bea998/model_index.json'

Hope it's a simple correction, I may need to revert to a previous version of the hub until resolved. I've also posted issue here: huggingface/diffusers#2729
Thanks for the assistance..

@Wauplin
Copy link
Contributor

Wauplin commented Mar 20, 2023

Hi @Skquark, thanks for reporting this.

I sorry that this bug has being introduced recently. It seems that Windows has issues following absolute symlinks in some cases. It has been reported in #1398, huggingface/diffusers#2729 and huggingface/transformers#22228 (and mentioned in #1396). I'll provide a quick ASAP and keep you updated.

@Wauplin
Copy link
Contributor

Wauplin commented Mar 22, 2023

Issue is reported as solved. I'm closing this issue definitively.

@Wauplin Wauplin closed this as completed Mar 22, 2023
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

Successfully merging a pull request may close this issue.

2 participants