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

Bug: NameError: name 'PeftModel' is not defined due to unguarded reference #735

Closed
fkarg opened this issue Sep 4, 2023 · 1 comment · Fixed by #668
Closed

Bug: NameError: name 'PeftModel' is not defined due to unguarded reference #735

fkarg opened this issue Sep 4, 2023 · 1 comment · Fixed by #668

Comments

@fkarg
Copy link

fkarg commented Sep 4, 2023

In version 0.7.1 (latest at time of writing), it is inevitable to get a NameError upon usage of the SFTTrainer.

Occurances of PeftModel, such as

if not isinstance(model, PeftModel):
are normally guarded by is_peft_available, e.g.:
if is_peft_available() and peft_config is not None:
However, this is not the case here:
elif not isinstance(model, (PreTrainedModel, PeftModel)):

As such, it is not available and thus (correctly) not imported where the unguarded reference correctly causes a NameError.

@fkarg fkarg changed the title Bug: NameError: name 'PeftModel' is not defined due to broken imports Bug: NameError: name 'PeftModel' is not defined due to unguarded reference Sep 4, 2023
@fkarg
Copy link
Author

fkarg commented Sep 4, 2023

(Will be fixed by #668)

(Issues related: #667 #601 and probably others)

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.

1 participant