Downloads · 30 days
0
mjbommar/magic-bert-tokenizer-4k
magic-bert-tokenizer-4k is a machine learning model from mjbommar. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
A byte-level BPE tokenizer trained on binary file data for the Magic-BERT project. This tokenizer is designed for binary file classification and analysis tasks.
Downloads · 30 days
0
Access
Public
Updated Dec 4, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json258 KB · 99%
From the Hugging Face model README
A byte-level BPE tokenizer trained on binary file data for the Magic-BERT project. This tokenizer is designed for binary file classification and analysis tasks.
| Token | ID | Purpose |
|---|---|---|
<|start|> | 0 | Beginning of sequence (BOS) |
<|end|> | 1 | End of sequence (EOS) |
<|pad|> | 2 | Padding |
<|unk|> | 3 | Unknown token |
<|cls|> | 4 | Classification token |
<|sep|> | 5 | Separator token |
<|mask|> | 6 | Mask token (for MLM) |
from transformers import AutoTokenizer
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("mjbommar/magic-bert-tokenizer-4k")
# Tokenize binary data (read as latin-1)
with open("some_file.bin", "rb") as f:
binary_data = f.read()
text = binary_data.decode("latin-1")
# Encode
tokens = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
print(tokens)
This tokenizer was trained using the HuggingFace tokenizers library with:
This tokenizer is designed to be used with Magic-BERT models for binary file MIME type classification. See the main model repository for more details.
Apache 2.0