You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fold the fix into `_get_prepend_scheme`: it now returns "first" instead
of "always" when `add_prefix_space=True`, so standalone Metaspace
pre_tokenizers minted via `convert_slow_tokenizer` no longer leave a
spurious "▁" prefix on the chunk after an added token (#28218). "first"
and "always" are identical on a standalone Metaspace for text without
added tokens.
WhitespaceSplit + Metaspace genuinely needs "always" so each split word
keeps its "▁" SentencePiece marker; PegasusConverter and XLNetTokenizer
now hardcode that scheme.
Drop the `_init_complete` guard and `_align_metaspace_for_added_tokens`
helper: the swap to "first" is inlined in `_add_tokens` and triggers
when a non-special token is registered (covers .json loads that still
bake in "always", whether the token comes from persisted state or a
user `add_tokens` call).
BigBird's persisted `<sep_*>`/`<length_*>` slots are non-special, so
the swap now runs at load time and the chunk after a literal `<s>`
loses its prefix; integration fixtures updated to match.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
integration_expected_decoded_text="This is a test <unk>I was born in 92000, and this is falsé.<unk>Hi Hello<unk>Hi Hello<unk> <unk> <unk> Hello<unk><s><unk>hi<s>there<unk>The following string should be properly encoded: Hello.<unk>But ird and <unk> ird <unk>Hey how are you doing"
integration_expected_decoded_text="This is a test <unk>I was born in 92000, and this is falsé.<unk>Hi Hello<unk>Hi Hello<unk> <unk> <unk> Hello<unk><s><unk>hi<s>there<unk>The following string should be properly encoded: Hello.<unk>But ird and <unk> ird <unk>Hey how are you doing"
0 commit comments