Sync unified PLaMo 3 tokenizer implementation

#2
by shemmipfn - opened
Preferred Networks, Inc. org Hugging Face CLI

Sync tokenization_plamo.py with the unified implementation from pfn-pfe-general/pelmo#16759.

  • Add the SGLang init_xgrammar() hook with byte-fallback tokenizer metadata.
  • Resolve model stop token IDs from generation_config.json, with tokenizer EOS fallback.
  • Import xgrammar dynamically only when the hook is called, so normal tokenizer loading does not require xgrammar.
  • Preserve add_bos_token and add_eos_token across save_pretrained() round trips.
Preferred Networks, Inc. org

LGTM

yhirokawa changed pull request status to merged

Sign up or log in to comment