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 repetition penalty #125

Merged
merged 3 commits into from
Dec 6, 2024
Merged

🔂 Fix repetition penalty #125

merged 3 commits into from
Dec 6, 2024

Conversation

tengomucho
Copy link
Collaborator

What does this PR do?

The generator was crashing when the request parameter container a repetition_penalty > 1.0. This was due to the logits processor expecting params to be torch tensors.
So this is now fixed, and a test has been added to detect any possible regression.

There was an error occurring because the logits processor was expecting
input_ids to be a torch tensor.
Since they are mostly used in the logits processor, this will prevent
having to convert them to torch tensor at each decode step.
Functionally it should be the same, but slightly more efficient.
@baptistecolle
Copy link
Collaborator

baptistecolle commented Dec 5, 2024

@tengomucho There are some failing tests 😕

Copy link
Collaborator

@baptistecolle baptistecolle left a comment

Choose a reason for hiding this comment

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

LGTM

@tengomucho tengomucho merged commit dadc0a6 into main Dec 6, 2024
3 checks passed
@tengomucho tengomucho deleted the fix-repetition-penalty branch December 6, 2024 08:25
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.

2 participants