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

Only cast logits to float when computing loss #34147

Merged

Conversation

ringohoffman
Copy link
Contributor

What does this PR do?

A few updates that were missed in #31292 and #33902.

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.

cc: @Cyrilvallez @gante @ArthurZucker

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 October 17, 2024 15:53
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 for bookeeping hehe

@ArthurZucker ArthurZucker merged commit 816f442 into huggingface:main Oct 18, 2024
15 of 17 checks passed
stevhliu pushed a commit to stevhliu/transformers that referenced this pull request Oct 21, 2024
* Only cast logits to float when computing loss

Some misses from huggingface#31292 and huggingface#33902

* Move logits.float() into existing if labels is not None branch
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
* Only cast logits to float when computing loss

Some misses from huggingface#31292 and huggingface#33902

* Move logits.float() into existing if labels is not None branch
@ringohoffman ringohoffman deleted the only-cast-logits-float-compute-loss branch March 9, 2025 21:49
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