mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[GH-ISSUE #289] Error: cannot access local variable 'active_adapters' where it is not associated with a value #164
Labels
No labels
bug
enhancement
enhancement
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
p-e-w/heretic#164
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @YuanBoXie on GitHub (Apr 8, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/289
Saving merged model...
Error: cannot access local variable 'active_adapters' where it is not associated with a value
@p-e-w commented on GitHub (Apr 10, 2026):
Which model is that? I can't reproduce this.
@YuanBoXie commented on GitHub (Apr 10, 2026):
It's a path to a lora fine-tune model, after I merge the lora weight to base model, it could be solved.
Does Heretic lack default support for LoRA paths? This seems like a feature that could be expanded.
@p-e-w commented on GitHub (Apr 10, 2026):
I don't understand what you mean. Please describe exactly what you did to get that error.
@umran666 commented on GitHub (Jun 11, 2026):
I Understand the cause of this one!
After
merge_and_unload(), the base model still has_hf_peft_config_loaded = True set. When saving, transformers tries to find active adapters that no longer exist, causing the crash.Setting
_hf_peft_config_loaded = Falseon the merged model fixes it completely. I can open the PR on this one..@p-e-w commented on GitHub (Oct 12, 2026):
Closing as this is a PEFT/Transformers bug, as discussed in #374.