Update README.md
Browse files
README.md
CHANGED
|
@@ -123,7 +123,8 @@ inputs = processor.apply_chat_template(
|
|
| 123 |
padding=True,
|
| 124 |
)
|
| 125 |
|
| 126 |
-
|
|
|
|
| 127 |
|
| 128 |
with torch.inference_mode():
|
| 129 |
output = model.generate(**inputs, max_new_tokens=200)
|
|
|
|
| 123 |
padding=True,
|
| 124 |
)
|
| 125 |
|
| 126 |
+
# Remove token_type_ids: HF uses it to enable bidirectional attention for image tokens; molmoweb is trained with causal attention only
|
| 127 |
+
inputs = {k: v.to("cuda") for k, v in inputs.items() if k != "token_type_ids"}
|
| 128 |
|
| 129 |
with torch.inference_mode():
|
| 130 |
output = model.generate(**inputs, max_new_tokens=200)
|