Skip to content

Commit 030d7b3

Browse files
committed
Remove MiniCPM-2B SentencePiece BPE support
TinyBPE now exclusively supports ByteLevel BPE tokenizers. - Remove models/minicpm.tbm (SentencePiece BPE, replaced by minicpm5) - Remove scripts/convert_minicpm.py (SentencePiece converter) - Remove tests/test_minicpm.py - Update registry, README, and model docs
1 parent a13eede commit 030d7b3

9 files changed

Lines changed: 5 additions & 130309 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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 tokenizer 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 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`.
1212

1313
## Why TinyBPE?
1414

@@ -75,7 +75,7 @@ tinybpe.list_models()
7575
| `qwen25` | Qwen 2.5 (0.5B–72B) | 151,643 |
7676
| `phi2` | Microsoft Phi-2 | 50,257 |
7777
| `deepseek-llm` | DeepSeek V2 (7B-Chat) | 100,013 |
78-
| `minicpm` | MiniCPM-2B (SentencePiece BPE) | 129,850 |
78+
| `minicpm5` | MiniCPM5-1B (ByteLevel BPE) | 130,050 |
7979

8080
### Training
8181

@@ -206,8 +206,6 @@ python scripts/convert_tiktoken.py cl100k_base -o models/cl100k_base.tbm
206206
python scripts/convert_hf_tokenizer.py tokenizer.json -o output.tbm
207207
python scripts/convert_hf_tokenizer.py Qwen/Qwen2.5-0.5B -o models/qwen25.tbm
208208
209-
# MiniCPM (SentencePiece BPE)
210-
python scripts/convert_minicpm.py -o models/minicpm.tbm
211209
```
212210

213211
See [`scripts/README.md`](scripts/README.md) for details.

README_zh.md

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

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

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

1313
## 为什么选择 TinyBPE?
1414

@@ -75,7 +75,7 @@ tinybpe.list_models()
7575
| `qwen25` | Qwen 2.5(0.5B–72B) | 151,643 |
7676
| `phi2` | Microsoft Phi-2 | 50,257 |
7777
| `deepseek-llm` | DeepSeek V2(7B-Chat) | 100,013 |
78-
| `minicpm` | MiniCPM-2B(SentencePiece BPE) | 129,850 |
78+
| `minicpm5` | MiniCPM5-1B(ByteLevel BPE) | 130,050 |
7979

8080
### 训练分词器
8181

@@ -206,8 +206,6 @@ python scripts/convert_tiktoken.py cl100k_base -o models/cl100k_base.tbm
206206
python scripts/convert_hf_tokenizer.py tokenizer.json -o output.tbm
207207
python scripts/convert_hf_tokenizer.py Qwen/Qwen2.5-0.5B -o models/qwen25.tbm
208208

209-
# MiniCPM(SentencePiece BPE)
210-
python scripts/convert_minicpm.py -o models/minicpm.tbm
211209
```
212210

213211
详见 [`scripts/README.md`](scripts/README.md)。

models/README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ ids = tok.encode("hello world")
3434
| `phi2` | Microsoft Phi-2 | 50,257 | GPT-2 regex | `microsoft/phi-2` |
3535
| `deepseek-llm` | DeepSeek V2 (7B-Chat) | 100,013 | None (raw) | `deepseek-ai/deepseek-llm-7b-chat` |
3636

37-
### SentencePiece BPE (converted)
38-
39-
| Model | LLM Compatibility | Vocab | Pre-tokenization | Notes |
40-
|---|---|---|---|---|
41-
| `minicpm` | MiniCPM-2B | 129,850 | None (SentencePiece) | Byte-level converted; needs manual SP normalization |
42-
4337
## Model Format
4438

4539
All files use the `.tbm` (TinyBPE Model v1) text format:
@@ -63,9 +57,6 @@ python scripts/convert_tiktoken.py o200k_base -o models/o200k_base.tbm
6357

6458
# HuggingFace tokenizer.json (local or Hub ID)
6559
python scripts/convert_hf_tokenizer.py Qwen/Qwen2.5-0.5B -o models/qwen25.tbm
66-
67-
# MiniCPM / SentencePiece BPE
68-
python scripts/convert_minicpm.py -o models/minicpm.tbm
6960
```
7061

7162
After conversion, add the model to the registry in `tinybpe/_registry.py` so it becomes available via `Tokenizer.from_pretrained()`.
@@ -82,7 +73,7 @@ After conversion, add the model to the registry in `tinybpe/_registry.py` so it
8273
| Phi-2 | ByteLevel BPE | Full support |
8374
| Llama 3 / 4 | ByteLevel BPE | Via `convert_hf_tokenizer.py` |
8475
| DeepSeek V2 / V3 | ByteLevel BPE | Full support |
85-
| MiniCPM | SentencePiece BPE | Converted (byte-level) |
76+
| MiniCPM5-1B | ByteLevel BPE | Full support |
8677
| Mistral | SentencePiece BPE / Tekken | Not supported |
8778
| Gemma 2 / 3 | SentencePiece Unigram | Not supported |
8879
| Claude 3 / 4 | Proprietary BPE | No public tokenizer |

0 commit comments

Comments
 (0)