Fix tokenizer.json decoder: use ByteLevel so text decodes correctly

#2

This repo's tokenizer.json uses a ByteLevel pre-tokenizer but its decoder is a Sequence (Replace / ByteFallback / Fuse / Strip) with no ByteLevel step, so byte-encoded tokens are never mapped back. As a result, decoded output contains literal Ġ (space) and Ċ (newline) artifacts, e.g. generation returns:

```pythonĊimportĠreĊ...

This also causes mlx_lm to select SPMStreamingDetokenizer, compounding the issue.

Fix: set the top-level decoder to ByteLevel ({"type":"ByteLevel","add_prefix_space":true,"trim_offsets":true,"use_regex":true}) — identical to the original mistralai/Devstral-Small-2-24B-Instruct-2512 and the working mlx-community/Devstral-Small-2-24B-Instruct-2512-4bit repos. Only the decoder field changes; vocab/merges are untouched.

Verified round-trip after the fix (spaces, newlines, indentation, unicode all decode correctly), and mlx_lm then selects BPEStreamingDetokenizer and produces clean output.

Cannot merge
This branch has merge conflicts in the following files:
  • tokenizer.json

Sign up or log in to comment