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

Fix a minor typo where a non-default token_dim would crash prompt tuning #459

Conversation

thomas-schillaci
Copy link
Contributor

@thomas-schillaci thomas-schillaci commented May 17, 2023

A one-line fix to address a bug where the variable token_dim can be used when not assigned.
In particular, performing prompt tuning with a non default token_dim causes peft to crash.

To illustrate this change, in this example notebook, changing PromptTuningConfig(task_type="SEQ_CLS", num_virtual_tokens=10) to PromptTuningConfig(task_type="SEQ_CLS", num_virtual_tokens=10, token_dim=x) raises a Local Variable Referenced Before Assignment Error, this PR fixes this issue.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 1, 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 @thomas-schillaci for the fix! 🤗

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.

3 participants