-
Notifications
You must be signed in to change notification settings - Fork 30.9k
Fix TypeError: find_adapter_config_file() got an unexpected keyword argument '_adapter_model_path' #41604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix TypeError: find_adapter_config_file() got an unexpected keyword argument '_adapter_model_path' #41604
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
CC: @ArthurZucker (who opened the PR), @Cyrilvallez (who reviewed it). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we are probably missing a test as the CI was full green on our side!
I encountered this error in the PEFT CI, not sure if we need a separate test for this in transformers. Here is a minimal reproducer: from transformers import AutoModelForCausalLM
model_id = "peft-internal-testing/opt-125m-dummy-lora"
AutoModelForCausalLM.from_pretrained(model_id) I can confirm that this PR fixes the issue, but relying on the side effect of calling |
Let me know if you would prefer that |
I think that's the cleaner solution but I'll leave the final decision to you / @ArthurZucker. |
Fix TypeError: find_adapter_config_file() got an unexpected keyword argument '_adapter_model_path'
maybe_load_adapters
The
adapter_kwargs
is passed tomaybe_load_adapters
as unpacked keyword arguments: Python does not pass the original dictionary, but instead creates a new dictionary inside the function; so thepop
inside the function does not have the intended behavior.transformers/src/transformers/modeling_utils.py
Lines 4383 to 4387 in 5db7307
This issue was introduced by PR:
from_pretrained
] Small refactorfrom_pretrained
: move around unrelated stuff #41445Related downstream issue: