Skip to content

Conversation

@syt-nju
Copy link
Contributor

@syt-nju syt-nju commented Apr 22, 2025

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?

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.

syt-nju added 3 commits April 22, 2025 11:51
The type of the variable "inputs" is incorrect. The issue was fixed only in this place; there might still be problems in other areas.
Copy link
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!

@qgallouedec qgallouedec changed the title Patch 1 💡 Fix type hint in _generate_and_score_completions Apr 22, 2025
@HuggingFaceDocBuilderDev

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.

@syt-nju
Copy link
Contributor Author

syt-nju commented Apr 22, 2025

Thanks!
The issue with this type hint should span the entire file, so I might need to trouble you to help me modify it together.

@qgallouedec
Copy link
Member

Thank you for helping to improve the accuracy of the type hints. Please feel free to open another PR if you feel that further corrections are necessary :)

@qgallouedec qgallouedec merged commit 1b4f189 into huggingface:main Apr 22, 2025
9 checks passed
@syt-nju syt-nju deleted the patch-1 branch April 22, 2025 16:30
@yuh8
Copy link

yuh8 commented Apr 22, 2025

This fix is also needed for

def _prepare_inputs(
        self, accumulated_local_batch: dict[str, Union[torch.Tensor, Any]]
    ) -> dict[str, Union[torch.Tensor, Any]]:

should change to

def _prepare_inputs(
        self, accumulated_local_batch: list[dict[str, Union[torch.Tensor, Any]]]
    ) -> dict[str, Union[torch.Tensor, Any]]:

SamY724 pushed a commit to SamY724/trl that referenced this pull request Sep 6, 2025
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.

4 participants