-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Bugfix] Inserted adapter_name to get_peft_model_state_dict function #626
Conversation
Accelerator init updated from logging_dir to project_dir. Newer versions of accelerate uses project_dir. logging_dir is deprecated
Update train_dreambooth.py
…ME it causes error
Bugfix: Adapter name variable inserted, when changing LORA_ADAPTER_NA…
The documentation is not available anymore as the PR was closed or merged. |
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.
Thank you @nafiturgut for the fix! 🤗
left a comment
@@ -19,7 +19,7 @@ | |||
|
|||
def get_module_kohya_state_dict(module: PeftModel, prefix: str, dtype: torch.dtype) -> Dict[str, torch.Tensor]: | |||
kohya_ss_state_dict = {} | |||
for peft_key, weight in get_peft_model_state_dict(module).items(): | |||
for peft_key, weight in get_peft_model_state_dict(module, adapter_name=LORA_ADAPTER_NAME).items(): |
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.
Here, the user needs to still update the LORA_ADAPTER_NAME
. Could you please add adapter_name
as kwarg with default value being LORA_ADAPTER_NAME
and pass that here.
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.
@pacman100 Added adapter_name as kwarg and changed function calls
Adapter name added as kwarg
Black code formatted
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.
Hello @nafiturgut, thank you for iterating, LGTM! ✨
Once the code quality issues are resolved, we can merge this. Please run make style
and make quality
to resolve the code quality issues.
Hello @pacman100, updated pr with style and quality checks. Thank you for review |
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.
Thank you!
Inserted adapter_name to get_peft_model_state_dict function, which was causing error when LORA_ADAPTER_NAME!='default'