bend-bpe-tokenizer@0.1.0.0 checks
0x0c46c789483b48a99efa2c996652d510
bend-bpe-tokenizer: Hugging Face byte-level BPE tokenizers (Qwen2/3, Qwen3.5+, Llama 3, GPT-2) in Bend, id for id with `tokenizers`, with laws.
bend-bpe-tokenizer@0.1.0.0 by tjpa
- Published
- 2026-11-12
- Size
- 263,231 bytes, 15 files
- License
- MIT-0 (no LICENSE file; the hub's default)
- Declarations
- 12 laws (12 proved), 322 defs, 26 types
Import
import bend-bpe-tokenizer@0.1.0.0/LAWS.bend as LAWS import 0x0c46c789483b48a99efa2c996652d510/LAWS.bend as LAWS import bend-bpe-tokenizer@0.1.0.0/PROOF.bend as PROOF import 0x0c46c789483b48a99efa2c996652d510/PROOF.bend as PROOF import bend-bpe-tokenizer@0.1.0.0/bpe.bend as Bpe import 0x0c46c789483b48a99efa2c996652d510/bpe.bend as Bpe import bend-bpe-tokenizer@0.1.0.0/hmap.bend as Hmap import 0x0c46c789483b48a99efa2c996652d510/hmap.bend as Hmap import bend-bpe-tokenizer@0.1.0.0/json.bend as Json import 0x0c46c789483b48a99efa2c996652d510/json.bend as Json import bend-bpe-tokenizer@0.1.0.0/nfc.bend as Nfc import 0x0c46c789483b48a99efa2c996652d510/nfc.bend as Nfc import bend-bpe-tokenizer@0.1.0.0/package.bend as Package import 0x0c46c789483b48a99efa2c996652d510/package.bend as Package import bend-bpe-tokenizer@0.1.0.0/specials.bend as Specials import 0x0c46c789483b48a99efa2c996652d510/specials.bend as Specials import bend-bpe-tokenizer@0.1.0.0/split.bend as Split import 0x0c46c789483b48a99efa2c996652d510/split.bend as Split import bend-bpe-tokenizer@0.1.0.0/tables.bend as Tables import 0x0c46c789483b48a99efa2c996652d510/tables.bend as Tables import bend-bpe-tokenizer@0.1.0.0/test/encode.bend as Encode import 0x0c46c789483b48a99efa2c996652d510/test/encode.bend as Encode import bend-bpe-tokenizer@0.1.0.0/tok.bend as Tok import 0x0c46c789483b48a99efa2c996652d510/tok.bend as Tok import bend-bpe-tokenizer@0.1.0.0/tree.bend as Tree import 0x0c46c789483b48a99efa2c996652d510/tree.bend as Tree import bend-bpe-tokenizer@0.1.0.0/utf8.bend as Utf8 import 0x0c46c789483b48a99efa2c996652d510/utf8.bend as Utf8
Modules
- LAWS.bend 24 declarations, 12 laws — The laws of bend-bpe-tokenizer. Each is stated over every input where its shape allows (the three partition laws);
- PROOF.bend 10 declarations — bend-bpe-tokenizer: the proofs of LAWS.bend.
- bpe.bend 25 declarations — Byte-level BPE: a piece's UTF-8 bytes as GPT-2's byte-level characters, merged pair by pair, lowest merge rank first
- hmap.bend 25 declarations — A String -> U32 map built in parallel: entries go to one of 2^depth buckets by their key's FNV-1a hash, a bit a
- json.bend 101 declarations — JSON (RFC 8259) from bytes, in one pass: a lexer state machine whose finished tokens drive a parser stack, so the
- nfc.bend 40 declarations — Unicode NFC, as UAX #15 defines it: full canonical decomposition, canonical ordering (a stable sort of each run of
- package.bend 0 declarations — bend-bpe-tokenizer: Hugging Face byte-level BPE tokenizers (Qwen2/3, Qwen3.5+, Llama 3, GPT-2) in Bend, id for id with `tokenizers`, with laws.
- specials.bend 25 declarations — Added tokens (the file's special and other added tokens) found in the raw text, before normalization, as Hugging
- split.bend 35 declarations — The pre-tokenizer: splits text into the pieces the split regex of a byte-level BPE family matches, as Hugging Face's
- tables.bend 4 declarations — GENERATED by dev/gen_tables.py from dev/classify.py's output: the Unicode data the tokenizer needs, as Hugging
- test/encode.bend 15 declarations — Encodes texts with a tokenizer.json, one line of ids (or an error) per text, for test/compare.py.
- tok.bend 74 declarations — bend-bpe-tokenizer: byte-level BPE tokenizers from a Hugging Face tokenizer.json, giving the ids Hugging Face's
- tree.bend 18 declarations — Balanced search trees for the Unicode tables (tables.bend): code point ranges to a value, code points to a list,
- utf8.bend 17 declarations — UTF-8: bytes to code points, refusing ill-formed input with the offset of the first byte of the bad sequence (as
Other files
- README.md 6,674 bytes
Dependencies
- bend-mathlib@0.8.1.0 via
PROOF.bend: import bend-mathlib@0.8.1.0/list.bend as ML
Dependents
No package in this build imports it.
Status on bend 2.0.40
| File | Status | Checker says | Time |
|---|---|---|---|
| LAWS.bend | open laws/TODOs | 12 TODOs found. Checked alone, a law without a def is a TODO; all of them are proved in files that check, so the package counts this file as checks. outputSOME PROOFS FAIL Error: 12 TODOs found. The code is incomplete, and not a valid proof yet. | 0.9 s |
| PROOF.bend | checks | ALL PROOFS CHECK | 9.4 s |
| bpe.bend | checks | ALL PROOFS CHECK | 0.5 s |
| hmap.bend | checks | ALL PROOFS CHECK | 0.6 s |
| json.bend | checks | ALL PROOFS CHECK | 0.6 s |
| nfc.bend | checks | ALL PROOFS CHECK | 0.5 s |
| package.bend | checks | ALL PROOFS CHECK | 10.1 s |
| specials.bend | checks | ALL PROOFS CHECK | 0.4 s |
| split.bend | checks | ALL PROOFS CHECK | 0.7 s |
| tables.bend | checks | ALL PROOFS CHECK | 0.7 s |
| test/encode.bend | checks | ALL PROOFS CHECK | 0.9 s |
| tok.bend | checks | ALL PROOFS CHECK | 0.8 s |
| tree.bend | checks | ALL PROOFS CHECK | 0.4 s |
| utf8.bend | checks | ALL PROOFS CHECK | 0.4 s |