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

assume empty lora dropout means 0.0 and add tests #2243

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

winglian
Copy link
Collaborator

@winglian winglian commented Jan 8, 2025

the previous behavior would fail if lora_dropout was None/null. This sets it as 0.0 at runtime if it is null.

@@ -1322,7 +1322,7 @@ def load_lora(model, cfg, inference=False, config_only=False):
target_modules=lora_target_modules,
layers_to_transform=cfg.peft_layers_to_transform,
layers_pattern=cfg.peft_layers_pattern,
lora_dropout=cfg.lora_dropout,
lora_dropout=cfg.lora_dropout if cfg.lora_dropout is not None else 0.0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we perhaps move this higher up in stack? Maybe to the validation stage instead? I think it's better to centralize this.

}
)
normalize_config(cfg)
cli_args = TrainerCliArgs()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to create this cli_args? Seems like you could just pass boolean to load_model below.

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

Successfully merging this pull request may close these issues.

2 participants