Instructions to use ModernVBERT/modernvbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ColPali
How to use ModernVBERT/modernvbert with ColPali:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -18,6 +18,26 @@ pipeline_tag: visual-document-retrieval
|
|
| 18 |
|
| 19 |

|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
## Model
|
| 22 |
This is the model card for `modernvbert`.
|
| 23 |
|
|
@@ -100,22 +120,6 @@ predicted_token = tokenizer.decode(predicted_token_id)
|
|
| 100 |
print("Predicted token:", predicted_token) # Predicted token: painting
|
| 101 |
```
|
| 102 |
|
| 103 |
-
## Migration guide to official `transformers` modeling
|
| 104 |
-
|
| 105 |
-
If you have a model based on the initial modeling, you will need to adapt the weigths to the new format supported by `transformers`.
|
| 106 |
-
We provide a conversion script in this repo, you simply need to run:
|
| 107 |
-
|
| 108 |
-
```bash
|
| 109 |
-
python convert_model_weights.py \
|
| 110 |
-
/path/to/legacy-modernvbert \
|
| 111 |
-
/path/to/converted-modernvbert \
|
| 112 |
-
```
|
| 113 |
-
|
| 114 |
-
The converted model:
|
| 115 |
-
- merges the split token embedding tables
|
| 116 |
-
- rewrites `model.connector.modality_projection.proj.weight`
|
| 117 |
-
- nests `model.vision_model...` under `model.vision_model.vision_model...`
|
| 118 |
-
|
| 119 |
## Evaluation
|
| 120 |
|
| 121 |
|
|
|
|
| 18 |
|
| 19 |

|
| 20 |
|
| 21 |
+
## 🚨 Migration guide to official `transformers` modeling
|
| 22 |
+
|
| 23 |
+
ModernVBERT is part of `transformers` since v5.3.0!
|
| 24 |
+
|
| 25 |
+
This becomes the official modeling for the model.
|
| 26 |
+
|
| 27 |
+
If you have a model based on the initial modeling, you can adapt the weigths to the new format supported by `transformers`.
|
| 28 |
+
We provide a conversion script in this repo, you simply need to run:
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
python convert_model_weights.py \
|
| 32 |
+
/path/to/legacy-modernvbert \
|
| 33 |
+
/path/to/converted-modernvbert \
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
The converted model:
|
| 37 |
+
- merges the split token embedding tables
|
| 38 |
+
- rewrites `model.connector.modality_projection.proj.weight`
|
| 39 |
+
- nests `model.vision_model...` under `model.vision_model.vision_model...`
|
| 40 |
+
|
| 41 |
## Model
|
| 42 |
This is the model card for `modernvbert`.
|
| 43 |
|
|
|
|
| 120 |
print("Predicted token:", predicted_token) # Predicted token: painting
|
| 121 |
```
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
## Evaluation
|
| 124 |
|
| 125 |
|