Code snippet fixes
#7
by
pcuenq
HF Staff
- opened
README.md
CHANGED
|
@@ -63,6 +63,7 @@ You can load the model as follows.
|
|
| 63 |
|
| 64 |
```python
|
| 65 |
from transformers import AutoProcessor, AutoModelForImageTextToText
|
|
|
|
| 66 |
|
| 67 |
model_path = "HuggingFaceTB/SmolVLM2-256M-Video-Instruct"
|
| 68 |
processor = AutoProcessor.from_pretrained(model_path)
|
|
@@ -82,9 +83,8 @@ messages = [
|
|
| 82 |
{
|
| 83 |
"role": "user",
|
| 84 |
"content": [
|
| 85 |
-
{"type": "
|
| 86 |
-
{"type": "
|
| 87 |
-
|
| 88 |
]
|
| 89 |
},
|
| 90 |
]
|
|
@@ -148,11 +148,9 @@ messages = [
|
|
| 148 |
{
|
| 149 |
"role": "user",
|
| 150 |
"content": [
|
| 151 |
-
{"type": "text", "text": "What is the similarity between
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
{"type": "text", "text": "and this image <image>"},
|
| 155 |
-
{"type": "image", "path": "image_2.png"},
|
| 156 |
]
|
| 157 |
},
|
| 158 |
]
|
|
|
|
| 63 |
|
| 64 |
```python
|
| 65 |
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 66 |
+
import torch
|
| 67 |
|
| 68 |
model_path = "HuggingFaceTB/SmolVLM2-256M-Video-Instruct"
|
| 69 |
processor = AutoProcessor.from_pretrained(model_path)
|
|
|
|
| 83 |
{
|
| 84 |
"role": "user",
|
| 85 |
"content": [
|
| 86 |
+
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg"},
|
| 87 |
+
{"type": "text", "text": "Can you describe this image?"},
|
|
|
|
| 88 |
]
|
| 89 |
},
|
| 90 |
]
|
|
|
|
| 148 |
{
|
| 149 |
"role": "user",
|
| 150 |
"content": [
|
| 151 |
+
{"type": "text", "text": "What is the similarity between these two images?"},
|
| 152 |
+
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg"},
|
| 153 |
+
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/0052a70beed5bf71b92610a43a52df6d286cd5f3/diffusers/rabbit.jpg"},
|
|
|
|
|
|
|
| 154 |
]
|
| 155 |
},
|
| 156 |
]
|