Skip to content

fix: skip pre-tokenizer when is_pretokenized=True#2204

Draft
pctablet505 wants to merge 1 commit into
huggingface:mainfrom
pctablet505:fix-1695-pretokenized-encode
Draft

fix: skip pre-tokenizer when is_pretokenized=True#2204
pctablet505 wants to merge 1 commit into
huggingface:mainfrom
pctablet505:fix-1695-pretokenized-encode

Conversation

@pctablet505

Copy link
Copy Markdown

Fixes #1695

When encode is called with is_pretokenized=True, the input is already split into tokens, so the tokenizer's pre-tokenizer should not be applied again. This change skips do_pre_tokenize for pre-tokenized sequences while keeping added-vocabulary extraction and normalization.

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.

Bug: is_pretokenized is not used when calling tokenizer.encode(...)

1 participant