Skip to content

Conversation

@d0rbu
Copy link

@d0rbu d0rbu commented Nov 20, 2025

When training with a tokenizer that has return_token_type_ids=True as default, we get an error from _validate_model_kwargs in the transformers library:

The following `model_kwargs` are not used by the model: ['token_type_ids'] (note: typos in the generate arguments will also show up in this list)

This sets return_token_type_ids to False to prevent this from happening in the GRPO trainer. PleIAs/Baguettotron and PleIAs/Monad are examples of models that I ran into this issue with.

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.

@qgallouedec
Copy link
Member

I'm not sure about this one. The issue probably comes from the fact that that the tokenizer configuration is wrong. A patch for this could be

trainer = GRPOTrainer(
    model="PleIAs/Monad",
    ...
)
trainer.processing_class.model_input_names.pop("token_type_ids")
trainer.train()

@d0rbu
Copy link
Author

d0rbu commented Nov 21, 2025

Got it, thanks for the feedback!

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