Skip to content

feat: load GPTNeoXTokenizer checkpoints (OLMoE) - #230

Merged
solderzzc merged 1 commit into
mainfrom
fix/gptneox-tokenizer
Oct 12, 2026
Merged

solderzzc merged 1 commit into
mainfrom
fix/gptneox-tokenizer

Conversation

@solderzzc

Copy link
Copy Markdown
Member

OLMoE ships tokenizer_class: GPTNeoXTokenizer. swift-transformers has no such entry (the table is internal, no register API), so the server exits with unsupportedTokenizer("GPTNeoXTokenizer") before it starts.

When tokenizer.json is model.type == "BPE" and the declared class (Fast stripped) is GPTNeoXTokenizer, load it from a scratch dir (symlinks + rewritten tokenizer_config.json saying GPT2Tokenizer), same pattern as the existing Unigram remap. Non-BPE or already-known classes are left alone; any error falls back to the original directory. Logs one line when it fires.

Verified (Swift 6.2 clone, release build): OLMoE-1B-7B-0125-Instruct-4bit loads and answers "Paris" to the capital-of-France prompt. 5 new unit tests in TokenizerClassRemapTests pass (remap, Fast suffix, known class untouched, non-BPE untouched, missing class untouched).

🤖 Generated with Claude Code

swift-transformers has no GPTNeoXTokenizer entry and throws before the server
starts. When tokenizer.json is BPE, load it from a scratch copy whose
tokenizer_config.json says GPT2Tokenizer. Verified end to end on
OLMoE-1B-7B-0125-Instruct-4bit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@solderzzc
solderzzc merged commit d40db4b into main Oct 12, 2026
29 of 30 checks passed
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.

1 participant