Skip to content

An Unified Example Format Checker #3373

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

Conversation

innerNULL
Copy link

@innerNULL innerNULL commented Apr 27, 2025

What does this PR do?

In trl/data_utils.py, some List are appeared in variables in different functions (e.g. is_conversational and apply_chat_template), and this may cause some maintaining burdens, and this is are start of checking example format information in an unified approach.

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.


def is_conversational(
example: dict[str, Any],
non_label_keys: List[str] = NON_LABEL_KEYS
Copy link
Member

Choose a reason for hiding this comment

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

what is this new arg?

@qgallouedec
Copy link
Member

Thanks for your contribution, I'm having trouble understanding the new logic. It seems to allow supported_keys, non_label_keys and label_keys to be set, but the supported keys are still hard-coded in your new function? Also, what do you mean by "label keys"? For example, why shouldn't chosen be one?
Can you provide a little more context on the motivation for this PR and the problem it solves?

@qgallouedec
Copy link
Member

Closing as no update from the author, feel free to re-open if needed

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