Datasets:
|
Download tokenizer/RECIPE.md from vecnode/supercollider-moe-dataset: direct link, hf CLI and curl.
- Browser
- Download file 5.01 kB
-
https://huggingface.co/datasets/vecnode/supercollider-moe-dataset/resolve/main/tokenizer/RECIPE.md
- Command line
-
hf download hf://datasets/vecnode/supercollider-moe-dataset/tokenizer/RECIPE.md
-
curl -L -o RECIPE.md https://huggingface.co/datasets/vecnode/supercollider-moe-dataset/resolve/main/tokenizer/RECIPE.md
5.01 kB
| # Tokenizer, and the exact token recipe | |
| The corpus in this repository is `{"text": …}` JSONL, and that is on purpose: text survives a tokenizer | |
| change, a library upgrade and a different model. But "25.8M tokens" and "the ids the model trained on" are | |
| claims a reader cannot check against JSONL. This folder is what makes them checkable — the tokenizer that | |
| produced the ids, the recipe in code, the measured counts, and a sha256 over the id stream itself. | |
| ## The tokenizer | |
| | | | | |
| |---|---| | |
| | family | `BPE` with a `ByteLevel` decoder (byte-level) | | |
| | vocabulary | **6,400** tokens, 6,108 merges, 36 added/special | | |
| | post-processor | `None` — nothing is added implicitly, so `add_special_tokens` does not change the ids | | |
| | `tokenizer.json` | 482,372 bytes · sha256 `8bf5868abfc7ea919186b57e2b411adefe3b0922b53052c5839937e166b9d395` | | |
| | specials | bos `<|im_start|>` = 1 · eos `<|im_end|>` = 2 · pad `<|endoftext|>` = 0 | | |
| These two files are byte-identical to the ones shipped with the released weights. | |
| `vecnode/sc-minimind-3-moe` @ `v1.0.0-198m`, `v1.0.0-51m`, `v1.0.0-91m`. | |
| Use them as a pair: a `tokenizer.json` from another revision would still load and still produce plausible ids, | |
| which is exactly the failure this folder exists to prevent. | |
| ## Pretraining — the recipe, exactly | |
| ```python | |
| from tokenizers import Tokenizer | |
| tk = Tokenizer.from_file("tokenizer/tokenizer.json") | |
| ids = tk.encode(text, add_special_tokens=False).ids # P1: len(ids) <= 510 for every row | |
| stream = [1, *ids, 2] # BOS prepended, EOS appended | |
| ``` | |
| That is the whole of it: no truncation (P1 in `SCHEMA.md` guarantees every published row fits the | |
| 512-token window with two spare), no padding, no special-token surprises. A trainer pads to 512 | |
| with `<|endoftext|>` = 0 and sets the labels to -100 on the padding, which changes nothing about the ids. | |
| ## SFT — and why there are no ids to verify | |
| The SFT loader is **not a pure function of the file**. Before tokenizing, `SFTDataset.__getitem__` picks up | |
| to ten system prompts and prepends one to **20% of rows** (`random.random()`), and strips empty | |
| `<think>` blocks with a second draw. Two runs over the same file produce two different id streams, both | |
| correct. So this folder publishes the fixed part — the chat template's rendering, in | |
| `stats.json` as `reference_ids_sha256` — and does not pretend it is the stream a run saw. If you are | |
| fine-tuning, apply `tokenizer_config.json`'s template and then add your own system prompt; the 20% is a | |
| training choice, not a property of the data. | |
| The SFT window is 512. Measured: **4 of 10,614 rows** tokenize past it and the loader truncates | |
| them (`rows_over_sft_seq` in `stats.json`); every other row fits. | |
| ## Verify it | |
| ```bash | |
| python tokenizer/tokenize.py --verify # every deterministic file, against stats.json | |
| python tokenizer/tokenize.py --file data/pretrain/train.jsonl --out ids.npy | |
| python tokenizer/tokenize.py --file data/pretrain/train.jsonl --out ids.npy --padded 512 | |
| ``` | |
| `--verify` re-encodes the published files in file order and compares the row count, the id count and the | |
| sha256 of the stream. A mismatch means the tokenizer, the recipe or the row order differs — in that order of | |
| likelihood — and the script exits non-zero rather than printing a number you might quote. | |
| ## What is measured | |
| | file | rows | tokens | chars/token | id stream | | |
| |---|---|---|---|---| | |
| | `data/pretrain/train.jsonl` | 59,179 | 25,247,960 | 2.181 | `73b92fefbd01b218…` | | |
| | `data/pretrain/val.jsonl` | 1,235 | 527,909 | 2.158 | `0a0f5ef74a7e43cc…` | | |
| | `data/sft/train.jsonl` | 10,614 | 2,608,405 | 2.245 | `f470b8bb112e1958…` | | |
| | `data/sft/val.jsonl` | 229 | 35,411 | 2.569 | `7c5023e65ae38957…` | | |
| The pretraining corpus is **25,775,869 tokens** across `data/pretrain/` (train + val), measured with the | |
| tokenizer above. `chars/token` is the useful sanity check for a 6,400-token vocabulary on | |
| code: prose runs near 4, SuperCollider with its punctuation and class names runs lower. | |
| ## What is not here: a tokenized copy of the corpus | |
| Deliberate, and measured. As `uint16` the pretraining ids are about 11% smaller than the JSONL (51.6 MB | |
| against 58.2 MB) and save a reader roughly a minute of encoding — and cost a second artifact to version, | |
| checksum and take down. The SFT ids would be *larger* than its text (a `(rows, 512)` ids+labels matrix is | |
| ~3.5× the 6.1 MB of JSONL, because of the padding and the label copy), and they are a random draw anyway. | |
| So the corpus stays text, and the exactness a tokenized dump would buy is bought here with a hash. | |
| ## Licence | |
| The vocabulary was merged from this corpus, so it is a derived artifact of it: the same mixed provenance | |
| applies (`PROVENANCE.md`), and it is published under the same takedown posture as the text. It is not a | |
| clean-code artifact, and `license: other` covers it exactly as it covers the data. | |