Skip to content

Commit 08ec85c

Browse files
committed
Remove Phi-2 tokenizer
- Remove models/phi2.tbm - Remove Phi-2 from registry, tests, and READMEs - 7 built-in models remaining
1 parent e1e7fbd commit 08ec85c

8 files changed

Lines changed: 11 additions & 50320 deletions

File tree

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
**An ultra-fast, lightweight BPE tokenizer and trainer with a pure-C core.**
1010

11-
Ever wished you could load a GPT-4 compatible tokenizer in **one line** without network calls? TinyBPE ships 8 pre-built ByteLevel BPE models directly in the package. The CPython C core runs BPE encoding/decoding at native speed — typically **10-50× faster** than pure-Python implementations while depending only on `regex`.
11+
Ever wished you could load a GPT-4 compatible tokenizer in **one line** without network calls? TinyBPE ships 7 pre-built ByteLevel BPE models directly in the package. The CPython C core runs BPE encoding/decoding at native speed — typically **10-50× faster** than pure-Python implementations while depending only on `regex`.
1212

1313
## Why TinyBPE?
1414

1515
| Feature | TinyBPE | tiktoken | HuggingFace tokenizers |
1616
|---|---|---|---|
1717
| **Core engine** | Pure C (CPython) | Pure Rust (PyO3) | Pure Rust (PyO3) |
1818
| **Dependencies** | `regex` only | `tiktoken` + Rust toolchain | `tokenizers` + Rust toolchain |
19-
| **Built-in models** | 8 models ship in package | Downloads on first use | Downloads on first use |
19+
| **Built-in models** | 7 models ship in package | Downloads on first use | Downloads on first use |
2020
| **Offline ready** | ✅ Fully offline | ❌ Requires download | ❌ Requires download |
2121
| **Model format** | Human-readable `.tbm` text | Binary blob | JSON / binary |
2222
| **One-liner load** | `Tokenizer.from_pretrained("cl100k_base")` | `tiktoken.get_encoding("cl100k_base")` | `AutoTokenizer.from_pretrained(...)` |
@@ -60,8 +60,8 @@ tok.decode(ids) # → 'hello world'
6060
import tinybpe
6161

6262
tinybpe.list_models()
63-
# ['cl100k_base', 'deepseek-v4', 'minicpm', 'o200k_base',
64-
# 'p50k_base', 'phi2', 'qwen35', 'r50k_base']
63+
# ['cl100k_base', 'deepseek-v4', 'minicpm5', 'o200k_base',
64+
# 'p50k_base', 'qwen35', 'r50k_base']
6565
```
6666

6767
### Built-in Model Catalog
@@ -73,7 +73,6 @@ tinybpe.list_models()
7373
| `p50k_base` | GPT-3 (davinci, curie, babbage, ada) | 50,280 |
7474
| `r50k_base` | GPT-2 | 50,256 |
7575
| `qwen35` | Qwen3.5 (0.8B-35B) | 247,843 |
76-
| `phi2` | Microsoft Phi-2 | 50,257 |
7776
| `deepseek-v4` | DeepSeek-V4 Flash | 127,997 |
7877
| `minicpm5` | MiniCPM5-1B (ByteLevel BPE) | 130,050 |
7978

README_zh.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
**纯 C 内核的超轻量高性能 BPE 分词器与训练器。**
1010

11-
只需**一行代码**即可加载 GPT-4 兼容分词器,无需联网。TinyBPE 内置 8 个 ByteLevel BPE 预训练模型,开箱即用。CPython C 扩展以原生速度执行 BPE 编码/解码——通常比纯 Python 实现**快 10–50 倍**,且仅依赖 `regex` 一个第三方库。
11+
只需**一行代码**即可加载 GPT-4 兼容分词器,无需联网。TinyBPE 内置 7 个 ByteLevel BPE 预训练模型,开箱即用。CPython C 扩展以原生速度执行 BPE 编码/解码——通常比纯 Python 实现**快 10–50 倍**,且仅依赖 `regex` 一个第三方库。
1212

1313
## 为什么选择 TinyBPE?
1414

1515
| 特性 | TinyBPE | tiktoken | HuggingFace tokenizers |
1616
|---|---|---|---|
1717
| **核心引擎** | 纯 C(CPython 扩展) | 纯 Rust(PyO3) | 纯 Rust(PyO3) |
1818
| **依赖** |`regex` | `tiktoken` + Rust 工具链 | `tokenizers` + Rust 工具链 |
19-
| **内置模型** | 8 个模型随包分发 | 首次使用时下载 | 首次使用时下载 |
19+
| **内置模型** | 7 个模型随包分发 | 首次使用时下载 | 首次使用时下载 |
2020
| **离线可用** | ✅ 完全离线 | ❌ 需要下载 | ❌ 需要下载 |
2121
| **模型格式** | 可读文本 `.tbm` 文件 | 二进制 blob | JSON / 二进制 |
2222
| **一行加载** | `Tokenizer.from_pretrained("cl100k_base")` | `tiktoken.get_encoding("cl100k_base")` | `AutoTokenizer.from_pretrained(...)` |
@@ -60,8 +60,8 @@ tok.decode(ids) # → 'hello world'
6060
import tinybpe
6161

6262
tinybpe.list_models()
63-
# ['cl100k_base', 'deepseek-v4', 'minicpm', 'o200k_base',
64-
# 'p50k_base', 'phi2', 'qwen35', 'r50k_base']
63+
# ['cl100k_base', 'deepseek-v4', 'minicpm5', 'o200k_base',
64+
# 'p50k_base', 'qwen35', 'r50k_base']
6565
```
6666

6767
### 内置模型目录
@@ -73,7 +73,6 @@ tinybpe.list_models()
7373
| `p50k_base` | GPT-3(davinci、curie、babbage、ada) | 50,280 |
7474
| `r50k_base` | GPT-2 | 50,256 |
7575
| `qwen35` | Qwen3.5(0.8B-35B) | 247,843 |
76-
| `phi2` | Microsoft Phi-2 | 50,257 |
7776
| `deepseek-v4` | DeepSeek-V4 Flash | 127,997 |
7877
| `minicpm5` | MiniCPM5-1B(ByteLevel BPE) | 130,050 |
7978

models/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ ids = tok.encode("hello world")
3131
| Model | LLM Compatibility | Vocab | Pre-tokenization | Source |
3232
|---|---|---|---|---|
3333
| `qwen35` | Qwen3.5 (0.8B-35B) | 247,843 | GPT-2 regex | `Qwen/Qwen3.5-0.8B` |
34-
| `phi2` | Microsoft Phi-2 | 50,257 | GPT-2 regex | `microsoft/phi-2` |
3534
| `deepseek-v4` | DeepSeek-V4 Flash | 127,997 | None (raw) | `deepseek-ai/DeepSeek-V4-Flash` |
3635

3736
## Model Format
@@ -70,7 +69,6 @@ After conversion, add the model to the registry in `tinybpe/_registry.py` so it
7069
| GPT-3 | `p50k_base` BPE | Full support |
7170
| GPT-2 | `r50k_base` BPE | Full support |
7271
| Qwen3.5 | ByteLevel BPE | Full support |
73-
| Phi-2 | ByteLevel BPE | Full support |
7472
| Llama 3 / 4 | ByteLevel BPE | Via `convert_hf_tokenizer.py` |
7573
| DeepSeek V2 / V3 | ByteLevel BPE | Full support |
7674
| MiniCPM5-1B | ByteLevel BPE | Full support |

0 commit comments

Comments
 (0)