Skip to content
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

Tokenizer's default behavior on unknown token #375

Merged
merged 4 commits into from
Oct 13, 2024

Conversation

SagiPolaczek
Copy link
Collaborator

@SagiPolaczek SagiPolaczek commented Oct 10, 2024

Support a configurable default value for the tokenizer op. Meaning we can change the default behavior of each instance, additionally to override it in the __call__() function itself.

Copy link
Collaborator

@mosheraboh mosheraboh left a comment

Choose a reason for hiding this comment

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

Thanks Sagi. Looks good.
One comment inline.

@@ -30,6 +30,7 @@ def __init__(
validate_ends_with_eos: Optional[bool] = True,
eos: Optional[str] = "<EOS>",
verbose: Optional[bool] = False,
on_unknown_default_value: Optional[str] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why None? set it directly to "warn".
Lets remove the option to set it to None also in the other function and just support "warn" or "raise"

Copy link
Collaborator

@mosheraboh mosheraboh left a comment

Choose a reason for hiding this comment

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

Looks great

@SagiPolaczek SagiPolaczek merged commit b654810 into master Oct 13, 2024
5 checks passed
@SagiPolaczek SagiPolaczek deleted the sagi/diff_unk_behavior_tkn branch October 13, 2024 10:58
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