Views
No views yet
tokenizers library. It was built as a learning exercise: text is scraped
from a Wikipedia article, a BPE tokenizer is trained on it, and the result is
wrapped as a PreTrainedTokenizerFast so it loads through AutoTokenizer.| Property | Value |
|---|---|
| Algorithm | Byte-level BPE |
| Vocabulary size | 2048 (2¹¹) |
| Special tokens | <unk>, <pad>, <bos>, <eos> |
| Pre-tokenizer | ByteLevel(add_prefix_space=False) |
| Decoder | ByteLevel |
| Training data | Plain text of the English Wikipedia article Large language model |
1from transformers import AutoTokenizer
2
3tokenizer = AutoTokenizer.from_pretrained("gorkemergune/my-tokenizer")
4
5example = "Hello! This is a very small tokenizer example."
6token_ids = tokenizer.encode(example)
7
8print("Tokens:", tokenizer.convert_ids_to_tokens(token_ids))
9print("Token IDs:", token_ids)
10print("Decoded:", tokenizer.decode(token_ids))scraper.py downloads the Wikipedia article as plain text into text.txt.script.py trains the byte-level BPE tokenizer on text.txt and pushes it here.