Describe the bug
new from_single_file implementation is always internet-first and using local config files only after timeout even if they are already present locally as they were previously downloaded.
code flow is from_single_file -> _download_diffusers_model_config_from_hub -> snapshot_download
and snapshot_download function in huggingface_hub is always checking online first and only on timeout fetching already existing local files first
so to avoid triggering snapshot_download, existing check
if not os.path.isdir(default_pretrained_model_config_name) inside from_single_file
needs to be expanded to cover already downloaded files first
you can verify by looking at simple message in console such as:
Fetching 11 files
that message is valid on first use/download, but should not be triggered every single time model load is triggered.
and message only comes from hf_hub online downloader.
and if you disconnect from network and try again, everything works just fine and model is loaded without that log message but only after connection timeout.
Reproduction
see above
Logs
No response
System Info
diffusers==0.28.0.dev
Who can help?
@yiyixuxu @DN6 @sayakpaul
Describe the bug
new
from_single_fileimplementation is always internet-first and using local config files only after timeout even if they are already present locally as they were previously downloaded.code flow is
from_single_file->_download_diffusers_model_config_from_hub->snapshot_downloadand
snapshot_downloadfunction inhuggingface_hubis always checking online first and only on timeout fetching already existing local files firstso to avoid triggering
snapshot_download, existing checkif not os.path.isdir(default_pretrained_model_config_name)insidefrom_single_fileneeds to be expanded to cover already downloaded files first
you can verify by looking at simple message in console such as:
that message is valid on first use/download, but should not be triggered every single time model load is triggered.
and message only comes from hf_hub online downloader.
and if you disconnect from network and try again, everything works just fine and model is loaded without that log message but only after connection timeout.
Reproduction
see above
Logs
No response
System Info
diffusers==0.28.0.dev
Who can help?
@yiyixuxu @DN6 @sayakpaul