Upload README.md with huggingface_hub
Browse files6 unmodified lines78910101112131213141516173 unmodified lines212223232425242526272829303131323233346 unmodified lines- code-generation---
# cofos_tokenizer# samg_tokenizer (NexusBPE)
Specialized SentencePiece BPE tokenizer for the **cofos** programming and logiclanguage model.Multilingual + action SentencePiece BPE tokenizer for **SAM-G**, the AMEFORGE~30M generalist instruction-action model. Includes atomic [CHAT]/[ACTION]mode tokens, the 10 SAM action domains, and JSON scaffolding atoms.
## Configuration- Vocabulary size: **32000**3 unmodified lines- Whitespace normalization: disabled (`identity` rule) — indentation preserved
## Special atomic tokensKeywords (`def`, `class`, `fn`, `struct`, `impl`, `return`, `async`, …),operators (`==`, `!=`, `=>`, `->`, `::`, `///`, …) and structural tags(`<python>`, `<code>`, `<explanation>`, …) are all guaranteed single tokens.Mode tokens (`[CHAT]`, `[ACTION]`), domains (`<ros>`, `<mqtt>`, …), JSON keys(`"op":`, `"params":`, …), code keywords (`def`, `fn`, `struct`, `async`, …),operators and structural tags are all guaranteed single tokens.
## Usage```pythonimport sentencepiece as spmsp = spm.SentencePieceProcessor()sp.Load("cofos_tokenizer.model")print(sp.EncodeAsPieces("def hello():\n return 42"))sp.Load("samg_tokenizer.model")print(sp.EncodeAsPieces('turn on the lamp [ACTION] {"domain":"home","op":"set_state"}'))```README.md+9-8