Repository navigation
vocab : implement PLaMo-3 tokenizer pre-segmentation - #30045
Conversation
The PLaMo-3 tokenizer inserts hard boundaries before running the Unigram DP, around <|plamo:...|>-looking text, and around runs of at least 4 identical characters or 2 spaces. Without them llama.cpp tokenizes code indentation and repeated punctuation differently from the reference. Reproduce the two re.sub() passes in llm_tokenizer_plamo2 by encoding each segment independently.
|
/bot review |
Automated code reviewReview of PR #30045 ( Checklists run: scope gate, security, general, plus vocab/conversion areas. The approach itself is sound: a Correctness points to verify against the reference (these are the only places I can see the port possibly diverging from (point 1) BOM handling is silently dropped for plamo3. (point 2) (point 3) Literal U+EE00 in user input is silently dropped ( Will slow the review: (point 4) No test coverage or verification evidence. Exact-match with the reference is the entire point of this PR, but nothing exercises it. At minimum, document in the PR description the adversarial cases checked against the reference (code indentation / 4+ repeats, 2-space runs, newline runs, (point 5) Worth noting for users: plamo-3 GGUFs converted before this PR carry Nits: (point 6) (point 7) Style is otherwise clean: ASCII only, concise comments (the run-skip invariant comment at line ~1586 is exactly the kind that earns its place), and the column alignment matches the repo clang-format config. This review was generated automatically by pi coding agent using |
|
Address bot points and we're good, if you want you can test the vocab (using |
Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
|
done. thank you for reviewing! |
* vocab : implement PLaMo-3 tokenizer pre-segmentation The PLaMo-3 tokenizer inserts hard boundaries before running the Unigram DP, around <|plamo:...|>-looking text, and around runs of at least 4 identical characters or 2 spaces. Without them llama.cpp tokenizes code indentation and repeated punctuation differently from the reference. Reproduce the two re.sub() passes in llm_tokenizer_plamo2 by encoding each segment independently. * add vocab type "plamo3" * Update src/llama-vocab.cpp Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co> * misc change --------- Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co> (cherry picked from commit abeada3)
* vocab : implement PLaMo-3 tokenizer pre-segmentation The PLaMo-3 tokenizer inserts hard boundaries before running the Unigram DP, around <|plamo:...|>-looking text, and around runs of at least 4 identical characters or 2 spaces. Without them llama.cpp tokenizes code indentation and repeated punctuation differently from the reference. Reproduce the two re.sub() passes in llm_tokenizer_plamo2 by encoding each segment independently. * add vocab type "plamo3" * Update src/llama-vocab.cpp Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co> * misc change --------- Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
* vocab : implement PLaMo-3 tokenizer pre-segmentation The PLaMo-3 tokenizer inserts hard boundaries before running the Unigram DP, around <|plamo:...|>-looking text, and around runs of at least 4 identical characters or 2 spaces. Without them llama.cpp tokenizes code indentation and repeated punctuation differently from the reference. Reproduce the two re.sub() passes in llm_tokenizer_plamo2 by encoding each segment independently. * add vocab type "plamo3" * Update src/llama-vocab.cpp Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co> * misc change --------- Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
Overview
fixes: #30043
The PLaMo-3 tokenizer inserts hard boundaries before running the Unigram DP, around
<|plamo:...|>-looking text, and around runs of at least 4 identical characters or 2 spaces. Without them llama.cpp tokenizes these cases (e.g. code indentation or repeated punctuation) differently from the reference.Reproduce the two re.sub() passes in llm_tokenizer_plamo2 by encoding each segment independently.
helloooohelloooohelloooohelloooohelloooohelloooohello worldhelloworldhello worldhelloworldhello worldhelloworldtokenizer.ggml.modelto "plamo3" or re-convert GGUF.Additional information
Requirements