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

[BugFix] Set alpha and dropout defaults in LoraConfig #390

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

apbard
Copy link
Contributor

@apbard apbard commented May 3, 2023

Instantiating and using a default LoraConfig results in errors due to the fact lora_alpha and lora_dropout gets initialised to None.
There are points in the code (see e.g., here, here, here) where it is assumed they have actual values.
Since all methods already have alpha=1 and dropout=0.0 as defaults I opted to change LoraConfig instead of adding None checks.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 3, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Thank you @apbard for fixing this, LGTM! 🤗 Left a suggestion

src/peft/tuners/lora.py Outdated Show resolved Hide resolved
@huggingface huggingface deleted a comment from github-actions bot Jun 8, 2023
Co-authored-by: Sourab Mangrulkar <13534540+pacman100@users.noreply.github.com>
Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Thank you for iterating @apbard

@pacman100 pacman100 merged commit 8563a63 into huggingface:main Jun 15, 2023
11 checks passed
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 this pull request may close these issues.

None yet

3 participants