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: sampling in flax keeps EOS #28378

Merged
merged 1 commit into from
Jan 15, 2024
Merged

Conversation

borisdayma
Copy link
Contributor

What does this PR do?

Fixes #28377

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR. @sanchit-gandhi

@borisdayma
Copy link
Contributor Author

Running the same example listed in #28377, we get the correct output with EOS token present before the PAD tokens:
["</s><s><s>My friends are cool but they eat too many carbs. I love carbs. The carb-averse among us have a love for dessert on this one. I've got some amazing desserts. I've been a junkie for 10 years. I can't go straight after dinner, I've been eating for 4. I love it. That's why I made the TV show.</s><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad>"]

Copy link
Member

@gante gante left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the fix!

@gante gante requested a review from ArthurZucker January 10, 2024 15:23
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks! Not generation tests were failing? 🤗 would expect some to include testing against decoded version. Could you run for Llama for example?

Copy link
Contributor

@sanchit-gandhi sanchit-gandhi left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @borisdayma!

@gante gante merged commit 735968b into huggingface:main Jan 15, 2024
19 checks passed
MadElf1337 pushed a commit to MadElf1337/transformers that referenced this pull request Jan 15, 2024
wgifford pushed a commit to wgifford/transformers that referenced this pull request Jan 21, 2024
AjayP13 pushed a commit to AjayP13/transformers that referenced this pull request Jan 22, 2024
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.

Flax generate sampling does not return EOS
4 participants