Skip to content
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

TypeError: PeftConfig.init() got an unexpected keyword argument 'device_map' #564

Closed
FartyPants opened this issue Jun 11, 2023 · 2 comments · Fixed by #575
Closed

TypeError: PeftConfig.init() got an unexpected keyword argument 'device_map' #564

FartyPants opened this issue Jun 11, 2023 · 2 comments · Fixed by #575

Comments

@FartyPants
Copy link

After some recent update you are now passing kwargs to PeftConfig from peft_model.py in from_pretrained
line 169 # load the config
config = PEFT_TYPE_TO_CONFIG_MAPPING[
PeftConfig.from_pretrained(model_id, subfolder=kwargs.get("subfolder", None), **kwargs).peft_type
].from_pretrained(model_id, subfolder=kwargs.get("subfolder", None), **kwargs)

but if the kwargs have 'device_map' or 'dtype' then it will blow in the construct of config.py
line 114: config = cls(**kwargs)
TypeError: PeftConfig.init() got an unexpected keyword argument 'device_map'

but at the same time you are actually expecting kwargs in from_pretrained to have 'device_map' for example
410: device_map = kwargs.get("device_map", "auto") in load_adapter perf_model.py is expecting it to have it.

@younesbelkada
Copy link
Contributor

Hi @FartyPants
#561 should partially solve the issue, I will work on a proper fix right after that PR gets merged

@younesbelkada
Copy link
Contributor

Hi @FartyPants
Again thanks for reporting, made #575 that should resolve the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants