Instructions to use cnmoro/blink-latin-26M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Model2Vec
How to use cnmoro/blink-latin-26M with Model2Vec:
from model2vec import StaticModel model = StaticModel.from_pretrained("cnmoro/blink-latin-26M") embeddings = model.encode(["It's dangerous to go alone!", "It's a secret to everybody."]) print(embeddings.shape) - Notebooks
- Google Colab
- Kaggle
Blink Latin 26M
Blink Latin 26M is a smaller version of MinishLab鈥檚 Blink Multilingual 64M static embedding model, intended for English, Portuguese, Spanish, and other languages written in Latin script. It uses the original model鈥檚 WordPiece tokenization and mean pooling. The source checkpoint is a7198ef875b9a756b8b641ab064542f7408e50f3. Original model card
What changed
- Removed vocabulary entries containing letters from non-Latin scripts, including Cyrillic, Han, kana, and Hangul. Latin-script accents and shared vocabulary were retained, including Polish words and names.
- Remapped tokenizer IDs to the smaller embedding table. Every retained 256-dimensional embedding row was copied exactly in float32. The model received no additional training or quantization.
- Included an optional native pooling encoder. It restores the source model鈥檚 length heuristic and can use the original checkpoint for text containing non-Latin scripts.
| Original | Blink Latin 26M | |
|---|---|---|
| Vocabulary entries | 250,000 | 103,548 |
| Embedding parameters | 64.0M | 26.5M |
| Embedding dimensions | 256 | 256 |
| Model and tokenizer on disk | 264.3 MB | 107.6 MB |
Quick start
Install model2vec and a recent tokenizers release. The evaluation used model2vec==0.8.2 and tokenizers==0.22.1.
from model2vec import StaticModel
model = StaticModel.from_pretrained("cnmoro/blink-latin-26M")
vectors = model.encode([
"The library opens at nine.",
"A biblioteca abre 脿s nove.",
"La biblioteca abre a las nueve.",
])
For faster batch encoding and the original truncation behavior, download the repo and use the included BlinkModel loader. The C compiler step enables native pooling. The loader can also use NumPy pooling.
hf download cnmoro/blink-latin-26M --local-dir blink-latin-26M
cd blink-latin-26M
python -m pip install regex
cc -O3 -march=native -shared -fPIC -o blink_pool.so blink_pool.c
from blink_latin import BlinkModel
model = BlinkModel.from_local(".")
vectors = model.encode(["Como voc锚 est谩?", "驴C贸mo est谩s?"])
For text with non-Latin names, quotations, or passages, download the source checkpoint and pass its local path as reference. The original model is loaded lazily when such text is encountered.
hf download minishlab/blink-multilingual-64M \
--revision a7198ef875b9a756b8b641ab064542f7408e50f3 \
--local-dir blink-original
model = BlinkModel.from_local(".", reference="blink-original")
Evaluation
The compact model produced bit-for-bit identical vectors on 6,072 FLORES-200 devtest sentences across English, Portuguese, Spanish, French, German, and Italian. Recall@1 matched in all six translation directions among English, Portuguese, and Spanish. FLORES-200
The mixed-script fallback matched the original vectors and similarity scores across 5,611 labeled pairs. In standalone mode, six news article vectors changed because those articles contained non-Latin text. Float16 and row-wise int8 trials changed vectors and were excluded from the release. STS Benchmark 路 ASSIN 2 路 STS22
With native pooling, median encoding time for 1,012 Portuguese sentences fell from 36.45 ms to 24.24 ms in standalone mode and 27.06 ms with fallback enabled. The test ran on a Ryzen 7 3700X with four tokenizer threads and multiprocessing disabled. Single-sentence latency was about 0.15 ms across configurations. Full benchmark results
To reproduce the evaluation from the downloaded repo, install scipy and pyarrow, then run the benchmark against the pinned source checkpoint.
OPENBLAS_NUM_THREADS=1 RAYON_NUM_THREADS=4 python benchmark.py \
--original blink-original --compact . --quantization-trials
- Downloads last month
- 35
Model tree for cnmoro/blink-latin-26M
Base model
minishlab/blink-multilingual-64M