Skip to content

fix: allow local LoRA paths in offline mode#14198

Closed
pctablet505 wants to merge 1 commit into
huggingface:mainfrom
pctablet505:fix-14195-offline-lora-local-paths
Closed

fix: allow local LoRA paths in offline mode#14198
pctablet505 wants to merge 1 commit into
huggingface:mainfrom
pctablet505:fix-14195-offline-lora-local-paths

Conversation

@pctablet505

Copy link
Copy Markdown

Fixes #14195

Moves the local file and directory checks in _best_guess_weight_name() before the offline-mode guard, so explicit local LoRA files and directories can be loaded when local_files_only=True or HF_HUB_OFFLINE=1 is set. Remote repository IDs without an explicit weight_name continue to raise in offline mode, and model_info() is still not called.

@fropych

fropych commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for looking into this. I opened #14195 to coordinate the fix and already have a local branch and commit ready, including focused regression tests. This would be my first open-source contribution, so I was hoping to take the implementation through the PR and review process myself.
Since the issue has not yet received maintainer acknowledgment, @sayakpaul, could you please advise whether I should open my PR or coordinate with #14198? I’m happy to collaborate and would like to avoid duplicate work.

@sayakpaul

Copy link
Copy Markdown
Member

@pctablet505 can you maintain the PR template and acknowledge how much AI assistance you had in this PR?

@fropych

fropych commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@sayakpaul, I would like to clarify the coordination history here.
In #14195, I explicitly said that I wanted to implement this fix and asked for confirmation before opening a PR. Since my work was AI-assisted, I followed the contribution guide and waited for maintainer acknowledgment.
While I was waiting, #14198 was opened by another contributor with essentially the same fix, without coordinating with me.
I have now opened #14204. This would be my first open-source contribution, and I was hoping to take it through the review process myself.
My PR:

  • follows the full PR template
  • clearly discloses the AI assistance
  • includes the self-review notes and actual check results
  • covers every regression case described in the issue
  • verifies that model_info() is not called in offline mode
  • preserves the existing behavior for directories with no matching files or multiple matches.

One public-API test in #14198 changes os.environ after HF_HUB_OFFLINE has already been imported. As a result, it does not actually exercise that offline path. My test patches the imported constant directly.
I’m happy to collaborate, but I would appreciate it if the coordination history and test coverage could be considered when deciding which PR should move forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offline mode rejects local LoRA files and directories without weight_name

3 participants