fix: allow local LoRA paths in offline mode#14198
Conversation
|
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. |
|
@pctablet505 can you maintain the PR template and acknowledge how much AI assistance you had in this PR? |
|
@sayakpaul, I would like to clarify the coordination history here.
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. |
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 whenlocal_files_only=TrueorHF_HUB_OFFLINE=1is set. Remote repository IDs without an explicitweight_namecontinue to raise in offline mode, andmodel_info()is still not called.