Visual Question Answering
Transformers
Safetensors
English
Chinese
minicpmv
feature-extraction
custom_code
Eval Results
Instructions to use openbmb/MiniCPM-V-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-V-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("visual-question-answering", model="openbmb/MiniCPM-V-2", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/MiniCPM-V-2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Add arguments to MiniCPMVConfig for vLLM support
Browse files- configuration_minicpm.py +10 -0
configuration_minicpm.py
CHANGED
|
@@ -209,6 +209,11 @@ class MiniCPMVConfig(MiniCPMConfig):
|
|
| 209 |
patch_size=14,
|
| 210 |
max_slice_nums=9,
|
| 211 |
scale_resolution=448,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
**kwargs,
|
| 213 |
):
|
| 214 |
self.vision_encoder = vision_encoder
|
|
@@ -219,4 +224,9 @@ class MiniCPMVConfig(MiniCPMConfig):
|
|
| 219 |
self.patch_size = patch_size
|
| 220 |
self.max_slice_nums = max_slice_nums
|
| 221 |
self.scale_resolution = scale_resolution
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
super().__init__(**kwargs)
|
|
|
|
| 209 |
patch_size=14,
|
| 210 |
max_slice_nums=9,
|
| 211 |
scale_resolution=448,
|
| 212 |
+
im_start_token_id=101,
|
| 213 |
+
im_end_token_id=102,
|
| 214 |
+
slice_start_token_id=111,
|
| 215 |
+
slice_end_token_id=112,
|
| 216 |
+
unk_token_id=0,
|
| 217 |
**kwargs,
|
| 218 |
):
|
| 219 |
self.vision_encoder = vision_encoder
|
|
|
|
| 224 |
self.patch_size = patch_size
|
| 225 |
self.max_slice_nums = max_slice_nums
|
| 226 |
self.scale_resolution = scale_resolution
|
| 227 |
+
self.im_start_token_id = im_start_token_id
|
| 228 |
+
self.im_end_token_id = im_end_token_id
|
| 229 |
+
self.slice_start_token_id = slice_start_token_id
|
| 230 |
+
self.slice_end_token_id = slice_end_token_id
|
| 231 |
+
self.unk_token_id = unk_token_id
|
| 232 |
super().__init__(**kwargs)
|