Add integration test for MetaspacePreTokenizer fix#321
Merged
pcuenca merged 1 commit intohuggingface:mainfrom Feb 26, 2026
Merged
Add integration test for MetaspacePreTokenizer fix#321pcuenca merged 1 commit intohuggingface:mainfrom
pcuenca merged 1 commit intohuggingface:mainfrom
Conversation
Test downloads kredor/punctuate-all tokenizer and verifies correct XLM-RoBERTa tokenization when prepend_scheme is used without addPrefixSpace.
There was a problem hiding this comment.
Pull request overview
This PR adds an integration test to verify the fix for the MetaspacePreTokenizer issue where XLM-RoBERTa tokenization was broken when prepend_scheme was used without addPrefixSpace. The test validates that the fix from PR #319 correctly handles the kredor/punctuate-all tokenizer, which is an XLM-RoBERTa model that relies on prepend_scheme: "always" in its Metaspace configuration.
Changes:
- Added
kredorPunctuateAllTokenizer()integration test that downloads thekredor/punctuate-allmodel and verifies correct token IDs for the input "okay so lets get started"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DePasqualeOrg
pushed a commit
to DePasqualeOrg/swift-tokenizers
that referenced
this pull request
Mar 4, 2026
Test downloads kredor/punctuate-all tokenizer and verifies correct XLM-RoBERTa tokenization when prepend_scheme is used without addPrefixSpace. Cherry-picked from huggingface/swift-transformers#321 (67baef8).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kredor/punctuate-alltokenizer and verifies correct XLM-RoBERTa tokenization whenprepend_schemeis used withoutaddPrefixSpaceTest plan
swift test --filter kredorPunctuateAllTokenizerpassesTokenizerTests.swift