Skip to content

fix _get_per_token_logps_and_entropies return type#5456

Open
kashif wants to merge 2 commits intomainfrom
kashif-patch-1
Open

fix _get_per_token_logps_and_entropies return type#5456
kashif wants to merge 2 commits intomainfrom
kashif-patch-1

Conversation

@kashif
Copy link
Copy Markdown
Collaborator

@kashif kashif commented Apr 4, 2026

fix _get_per_token_logps_and_entropies return type

What does this PR do?

Fixes # (issue)

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? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

AI writing disclosure

We welcome the use of AI tools to help with contributions. For transparency and to help us improve our review process, please indicate the level of AI involvement in this PR.

  • No AI usage: the PR was written entirely by a human.
  • AI-assisted: some parts were suggested or improved by AI, but the PR was written and reviewed by a human.
  • AI-generated: the PR was mostly or fully generated by an AI tool.

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.


Note

Low Risk
Type-hint-only change that aligns _get_per_token_logps_and_entropies with its actual (logps, entropies) return shape; low risk aside from potential downstream typing/IDE expectations.

Overview
Updates _get_per_token_logps_and_entropies in both grpo_trainer.py and rloo_trainer.py to annotate the return value as a tuple (per_token_logps, per_token_entropies|None) instead of a dict, matching the function’s actual return.

Reviewed by Cursor Bugbot for commit 3c3f0db. Bugbot is set up for automated code reviews on this repo. Configure here.

@kashif kashif changed the title Change return type from dict to tuple in _get_per_token_logps_and_ent… fix _get_per_token_logps_and_entropies return type Apr 4, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 08c44a1. Configure here.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08c44a1af0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Copy Markdown
Member

@qgallouedec qgallouedec left a comment

Choose a reason for hiding this comment

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

Thanks

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