diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Correct hf hub download

Open patrickvonplaten opened this issue 3 years ago • 1 comments

Make sure only local files are downloaded if HF_HUB_OFFLINE is set to a truthy value.

patrickvonplaten avatar Dec 19 '22 16:12 patrickvonplaten

The documentation is not available anymore as the PR was closed or merged.

The issue fixed in this PR has reappeared, and it was caused by this PR. It can be reproduced using the code here: https://github.com/huggingface/diffusers/issues/1717#issuecomment-1357926423

  • diffusers: 0.25.0
  • huggingface-hub: 0.20.2

Sanster avatar Jan 16 '24 10:01 Sanster

Thanks for the bug report @Sanster - @Wauplin do you maybe have an idea how to fix it? Otherwise, I can dive a bit deeper here as well!

patrickvonplaten avatar Jan 17 '24 10:01 patrickvonplaten

Hmm, I thought this was definitely fixed with https://github.com/huggingface/diffusers/pull/6456 and https://github.com/huggingface/diffusers/pull/6467 :confused: Let me have a look at it. I'll try to reproduce with https://github.com/huggingface/diffusers/issues/1717#issuecomment-1357926423 and report back.

Wauplin avatar Jan 17 '24 12:01 Wauplin

I have been to reproduce it with diffusers 0.25.0. In fact, this is indeed fixed by https://github.com/huggingface/diffusers/pull/6456 and https://github.com/huggingface/diffusers/pull/6467 but they haven't made it to the 0.25.0 release. I retried by installing diffusers from main and it worked as expected.

So @patrickvonplaten would it be possible to either make a patch release 0.25.1 with those two or to make a 0.26.0 soon?

@Sanster in the meantime, you can install diffusers from source with pip install diffusers@git+https://github.com/huggingface/diffusers and it should fix your problem.

Wauplin avatar Jan 17 '24 13:01 Wauplin

Let's make a patch release for this I'd say (cc @sayakpaul wdyt?)

patrickvonplaten avatar Jan 17 '24 14:01 patrickvonplaten

Actually I think just doing pip install --upgrade huggingface_hub should fix the problem no? Not sure we actually need a diffusers patch release here

patrickvonplaten avatar Jan 17 '24 14:01 patrickvonplaten

Yes the patch release is needed to catch the OfflineModeIsEnabled exception here. Based on https://github.com/huggingface/diffusers/pull/1767#issuecomment-1893417458, @Sanster already have the latest huggingface_hub release.

Wauplin avatar Jan 17 '24 14:01 Wauplin

Makes sense, sorry I misunderstood the previous comment a bit 😅 https://pypi.org/project/diffusers/0.25.1/

patrickvonplaten avatar Jan 17 '24 16:01 patrickvonplaten