Skip to content

Loading LORA weights with load_lora_weights do not respect HF_HUB_OFFLINE / local_file_only #6089

@Wauplin

Description

@Wauplin

First reported by @rvorias in huggingface/huggingface_hub#1893 (comment).

TL;DR: Loading lora weights on a pipeline makes a call to the Hub even when HF_HUB_OFFLINE=1 is set as environment variable (or local_file_only=True is passed as parameter), which is not expected.

This seems to be due to the _best_guess_weight_name method that try to guess which file to load when the LoRA filename is not provided. It makes a call to model_info to check which files exist on the Hub repo.

pipeline.load_lora_weights(
  "latent-consistency/lcm-lora-sdxl",
  adapter_name="lcm",
  cache_dir=cache_dir,
  local_files_only=True,
)

Suggestions:

  • raise an error if offline mode => "hey you should pass a filename"
  • check local cache if offline mode => try to guess based on that locally saved files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions