Rename trainer arg tokenizer to processing_class#2162
Conversation
|
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. |
…ggingface/trl into tokenizer_to_processing_class
| def generate_completions(self, sampling: bool = False): | ||
| args = self.args | ||
| tokenizer = self.tokenizer | ||
| processing_class = self.processing_class |
There was a problem hiding this comment.
I may be missing something but is this required? Cannot we just use self.processing_class?
There was a problem hiding this comment.
You're right. Same for args. It will probably need some refactoring in the future
There was a problem hiding this comment.
I've seen that in other places too so maybe there's a rationale that I don't see for that? Not sure, but sure we'll keep it in mind
Co-authored-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
Co-authored-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
Co-authored-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
Co-authored-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
|
|
trl version: 0.12.0.dev0 |
same issue. checked the local source code, indeed no argument 'processing_class'. why's that? |
|
you need to use the main version of |
got it, thanks |
we use positional args to obtain model and optimizer, however, this has the un-needed tokenizer argument between them due to recent changes, the tokenizer arg is now renamed to processing_class, see: + huggingface/trl#2162 + huggingface/transformers#32385 leading to unexpected breakdown of scanner the line relevant to us is here: https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L523 since we anyway don't depend on this arg, switch out to using model and opt from the kwargs
What does this PR do?
Follows huggingface/transformers#32385
Fixes #2161
Ensure backward compatibility for DPO and SFT only
TODO
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines.
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.