Upload folder using huggingface_hub
Browse files- README.md +60 -0
- config.json +33 -0
- model.safetensors +3 -0
- preprocessor_config.json +5 -0
README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- HuggingFaceFW/fineweb
|
| 5 |
+
- HuggingFaceFW/fineweb-2
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
- uk
|
| 9 |
+
- zh
|
| 10 |
+
- hi
|
| 11 |
+
- ko
|
| 12 |
+
- ar
|
| 13 |
+
- th
|
| 14 |
+
- el
|
| 15 |
+
tags:
|
| 16 |
+
- pixel
|
| 17 |
+
- mae
|
| 18 |
+
- vit
|
| 19 |
+
- tokenization-free
|
| 20 |
+
---
|
| 21 |
+
# MPIXEL
|
| 22 |
+
|
| 23 |
+
MPIXEL, introduced in [Scaling Multilingual Pretraining of Pixel Language Models](https://arxiv.org/abs/2610.29681), is a family of multilingual pixel language models, which operate on visually rendered text. Our main models, `mpixel-base` (86M parameters) and `mpixel-large` (307M parameters), are pretrained on sixteen languages that span ten writing systems. MPIXEL uses adaptive rendering: it renders text as grapheme bigrams by default, Chinese, Japanese and Korean text one character per patch, and Arabic and Hebrew text word by word.
|
| 24 |
+
|
| 25 |
+
This model is `mpixel-8l`, which is pretrained on eight languages: English, Hindi, Chinese, Ukrainian, Korean, Thai, Modern Greek and Standard Arabic.
|
| 26 |
+
|
| 27 |
+
## Basic usage
|
| 28 |
+
To use our models, please first install our [`mpixel` package](https://github.com/ilkerkesen/mpixel). Here is an example of loading a pretrained model and encoding input text:
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from transformers import AutoModel
|
| 32 |
+
import mpixel.models.auto_register # registers MPIXEL with the Auto classes
|
| 33 |
+
from mpixel.processing import MPIXELProcessor
|
| 34 |
+
|
| 35 |
+
processor = MPIXELProcessor.from_pretrained("Team-PIXEL/mpixel-8s")
|
| 36 |
+
model = AutoModel.from_pretrained("Team-PIXEL/mpixel-8s")
|
| 37 |
+
|
| 38 |
+
inputs = processor(["Hello world!", "The quick brown fox jumps over the lazy dog."])
|
| 39 |
+
outputs = model(**inputs)
|
| 40 |
+
|
| 41 |
+
print(outputs.last_hidden_state.shape) # torch.Size([2, 513, 768])
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
For further information, please take a look at our repository: [https://github.com/ilkerkesen/mpixel](https://github.com/ilkerkesen/mpixel).
|
| 45 |
+
|
| 46 |
+
## Citation
|
| 47 |
+
|
| 48 |
+
If you find MPIXEL beneficial for your research, please cite it,
|
| 49 |
+
|
| 50 |
+
```
|
| 51 |
+
@misc{kesen2026scalingmultilingualpretrainingpixel,
|
| 52 |
+
title={Scaling Multilingual Pretraining of Pixel Language Models},
|
| 53 |
+
author={Ilker Kesen and Jenny Kunz and Kasra Malihi and Desmond Elliott},
|
| 54 |
+
year={2026},
|
| 55 |
+
eprint={2610.29681},
|
| 56 |
+
archivePrefix={arXiv},
|
| 57 |
+
primaryClass={cs.CL},
|
| 58 |
+
url={https://arxiv.org/abs/2610.29681},
|
| 59 |
+
}
|
| 60 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"MPIXELForPreTraining"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"decoder_hidden_size": 512,
|
| 7 |
+
"decoder_intermediate_size": 2048,
|
| 8 |
+
"decoder_num_attention_heads": 16,
|
| 9 |
+
"decoder_num_hidden_layers": 8,
|
| 10 |
+
"dtype": "float32",
|
| 11 |
+
"head_init": "pytorch",
|
| 12 |
+
"hidden_act": "gelu",
|
| 13 |
+
"hidden_dropout_prob": 0.1,
|
| 14 |
+
"hidden_size": 768,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 3072,
|
| 17 |
+
"layer_norm_eps": 1e-12,
|
| 18 |
+
"mask_ratio": 0.25,
|
| 19 |
+
"max_num_patches": 512,
|
| 20 |
+
"model_type": "mpixel",
|
| 21 |
+
"norm_pix_loss": true,
|
| 22 |
+
"num_attention_heads": 12,
|
| 23 |
+
"num_channels": 3,
|
| 24 |
+
"num_hidden_layers": 12,
|
| 25 |
+
"patch_embedding_init": null,
|
| 26 |
+
"patch_size": 16,
|
| 27 |
+
"pooler_add_layer_norm": true,
|
| 28 |
+
"pooling_mode": "mean",
|
| 29 |
+
"qkv_bias": true,
|
| 30 |
+
"reference_compile": false,
|
| 31 |
+
"rope_theta": 160000.0,
|
| 32 |
+
"transformers_version": "4.57.3"
|
| 33 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:730ba9519ae49d908d8805fb468460519151b81c118742f8123d1db97bdf319f
|
| 3 |
+
size 446661824
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"patch_size": 16,
|
| 3 |
+
"max_num_patches": 512,
|
| 4 |
+
"font_size": 12
|
| 5 |
+
}
|