Skip to content

Fix format mistake in string repr of tokenizer objects#34493

Merged
ArthurZucker merged 5 commits intohuggingface:mainfrom
gpetho:main
Oct 30, 2024
Merged

Fix format mistake in string repr of tokenizer objects#34493
ArthurZucker merged 5 commits intohuggingface:mainfrom
gpetho:main

Conversation

@gpetho
Copy link
Contributor

@gpetho gpetho commented Oct 29, 2024

This PR fixes issue #34437

The repr of tokenizer tokens looks confusing and just stupid, like this: `Tokenizer(...), added_tokens_decoder={1: ..., 2: ...}`. The dict that is the value of the added_tokens_decoder attribute is outside of the parentheses of the tokenizer object, whereas all other attributes are inside the parentheses like they should be.

This commit fixes this bug.
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

LGTM thanks 🤗

@ArthurZucker ArthurZucker merged commit 25a9fc5 into huggingface:main Oct 30, 2024
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
…4493)

* fix repr string format for tokenizer objects

The repr of tokenizer tokens looks confusing and just stupid, like this: `Tokenizer(...), added_tokens_decoder={1: ..., 2: ...}`. The dict that is the value of the added_tokens_decoder attribute is outside of the parentheses of the tokenizer object, whereas all other attributes are inside the parentheses like they should be.

This commit fixes this bug.

* cos: add newline before closing parenthesis of repr string
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