Safetensors
mpixel
pixel
mae
vit
tokenization-free
ilkerkesen commited on
Commit
6e3d37e
·
verified ·
1 Parent(s): 6057c08

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +63 -0
  2. config.json +33 -0
  3. model.safetensors +3 -0
  4. preprocessor_config.json +5 -0
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - da
12
+ - tr
13
+ - fi
14
+ - es
15
+ - ko
16
+ - ar
17
+ - th
18
+ - el
19
+ - bn
20
+ - vi
21
+ - he
22
+ - fa
23
+ tags:
24
+ - pixel
25
+ - mae
26
+ - vit
27
+ - tokenization-free
28
+ ---
29
+ # MPIXEL
30
+
31
+ 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.
32
+
33
+ ## Basic usage
34
+ 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:
35
+
36
+ ```python
37
+ from transformers import AutoModel
38
+ import mpixel.models.auto_register # registers MPIXEL with the Auto classes
39
+ from mpixel.processing import MPIXELProcessor
40
+ processor = MPIXELProcessor.from_pretrained("Team-PIXEL/mpixel-large")
41
+ model = AutoModel.from_pretrained("Team-PIXEL/mpixel-large")
42
+ inputs = processor(["Hello world!", "The quick brown fox jumps over the lazy dog."])
43
+ outputs = model(**inputs)
44
+ print(outputs.last_hidden_state.shape) # torch.Size([2, 513, 768])
45
+ ```
46
+
47
+ For further information, please take a look at our repository: [https://github.com/ilkerkesen/mpixel](https://github.com/ilkerkesen/mpixel).
48
+
49
+ ## Citation
50
+
51
+ If you find MPIXEL beneficial for your research, please cite it,
52
+
53
+ ```
54
+ @misc{kesen2026scalingmultilingualpretrainingpixel,
55
+ title={Scaling Multilingual Pretraining of Pixel Language Models},
56
+ author={Ilker Kesen and Jenny Kunz and Kasra Malihi and Desmond Elliott},
57
+ year={2026},
58
+ eprint={2610.29681},
59
+ archivePrefix={arXiv},
60
+ primaryClass={cs.CL},
61
+ url={https://arxiv.org/abs/2610.29681},
62
+ }
63
+ ```
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": 1024,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 4096,
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": 16,
23
+ "num_channels": 3,
24
+ "num_hidden_layers": 24,
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:7acccd2baf890911dd334d2a7d64a2d1817df14d3ef9cc825273e5b76e41f732
3
+ size 1317019656
preprocessor_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "patch_size": 16,
3
+ "max_num_patches": 512,
4
+ "font_size": 12
5
+ }