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
|
| 8 |
+
- allenai/MolmoWeb-SyntheticQA
|
| 9 |
+
- allenai/MolmoWeb-SyntheticGround
|
| 10 |
+
language:
|
| 11 |
+
- en
|
| 12 |
+
base_model:
|
| 13 |
+
- Qwen/Qwen3-8B
|
| 14 |
+
- google/siglip-so400m-patch14-384
|
| 15 |
+
pipeline_tag: image-text-to-text
|
| 16 |
+
library_name: transformers
|
| 17 |
+
tags:
|
| 18 |
+
- multimodal
|
| 19 |
+
- olmo
|
| 20 |
+
- molmo
|
| 21 |
+
- molmo2
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
<img src="molmoweb_logo.png" alt="Logo for the MolmoWeb Project" style="width: auto; height: 50px;">
|
| 25 |
+
|
| 26 |
+
# MolmoWeb-4B
|
| 27 |
+
|
| 28 |
+
MolmoWeb is a family of fully open multimodal web agents. MolmoWeb agents achieve state-of-the-art results outperforming similar scale open-weight-only
|
| 29 |
+
models such as Fara-7B, UI-Tars-1.5-7B, and Holo1-7B. MolmoWeb-8B also surpasses set-of-marks
|
| 30 |
+
(SoM) agents built on much larger closed frontier models like GPT-4o. We further demonstrate
|
| 31 |
+
consistent gains through test-time scaling via parallel rollouts with best-of-N selection, achieving 94.7%
|
| 32 |
+
and 60.5% pass@4 (compared to 78.2% and 35.3% pass@1)on WebVoyager and Online-Mind2Web
|
| 33 |
+
respectively.
|
| 34 |
+
|
| 35 |
+
**Learn more** about the MolmoWeb family [in our announcement blog post](https://allenai.org/blog/molmoweb).
|
| 36 |
+
|
| 37 |
+
MolmoWeb-8B is based on [Molmo2](https://arxiv.org/abs/2601.10611) architecture, which uses [Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) and [SigLIP 2](https://huggingface.co/google/siglip-so400m-patch14-384) as vision backbone.
|
| 38 |
+
|
| 39 |
+
Ai2 is commited to open science. The MolmoWeb datasets are available [here](https://huggingface.co/collections/allenai/molmoweb-data).
|
| 40 |
+
All other artifacts used in creating MolmoWeb (training code, [evaluations](https://github.com/allenai/molmoweb), intermediate checkpoints) will be made available, furthering our commitment to open-source AI development and reproducibility.
|
| 41 |
+
|
| 42 |
+
Quick links:
|
| 43 |
+
- 💬 [Demo](https://molmoweb.allen.ai/)
|
| 44 |
+
- 📂 [All Models](https://huggingface.co/collections/allenai/molmoweb)
|
| 45 |
+
- 📃 [Paper](https://allenai.org/papers/molmoweb)
|
| 46 |
+
- 🎥 [Blog with Videos](https://allenai.org/blog/molmoweb)
|
| 47 |
+
|
| 48 |
+
## Quick Start
|
| 49 |
+
```python
|
| 50 |
+
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 51 |
+
from PIL import Image
|
| 52 |
+
import requests
|
| 53 |
+
import torch
|
| 54 |
+
from jinja2 import Template
|
| 55 |
+
|
| 56 |
+
checkpoint_dir = "allenai/MolmoWeb-4B"
|
| 57 |
+
|
| 58 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
| 59 |
+
checkpoint_dir,
|
| 60 |
+
trust_remote_code=True,
|
| 61 |
+
dtype="auto",
|
| 62 |
+
device_map="auto",
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
processor = AutoProcessor.from_pretrained(
|
| 66 |
+
checkpoint_dir,
|
| 67 |
+
trust_remote_code=True,
|
| 68 |
+
padding_side="left",
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
MOLMOWEB_THINK_TEMPLATE = Template(
|
| 73 |
+
"""
|
| 74 |
+
# GOAL
|
| 75 |
+
{{ task_description }}
|
| 76 |
+
|
| 77 |
+
# PREVIOUS STEPS
|
| 78 |
+
{% for action in past_actions: -%}
|
| 79 |
+
## Step {{ action['index'] }}
|
| 80 |
+
THOUGHT: {{ action['thought'] }}
|
| 81 |
+
ACTION: {{ action['action'] }}
|
| 82 |
+
{% endfor %}
|
| 83 |
+
# CURRENTLY ACTIVE PAGE
|
| 84 |
+
Page {{ page_index }}: {{ page_title }} | {{ page_url }}
|
| 85 |
+
|
| 86 |
+
# NEXT STEP
|
| 87 |
+
|
| 88 |
+
"""
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
task_description = "Tell me about the Ai2 PIROR team's recent projects"
|
| 92 |
+
past_actions = []
|
| 93 |
+
user_message = MOLMOWEB_THINK_TEMPLATE.render(
|
| 94 |
+
page_title=None,
|
| 95 |
+
page_url="about:blank",
|
| 96 |
+
page_index=0,
|
| 97 |
+
task_description=task_description,
|
| 98 |
+
past_actions=[]
|
| 99 |
+
)
|
| 100 |
+
system_message = "molmo_web_think"
|
| 101 |
+
prompt = f"{system_message}: {user_message}"
|
| 102 |
+
|
| 103 |
+
blank_image = Image.new("RGB", (1280, 720), color="white")
|
| 104 |
+
|
| 105 |
+
image_messages = [
|
| 106 |
+
{
|
| 107 |
+
"role": "user",
|
| 108 |
+
"content": [
|
| 109 |
+
{"type": "text", "text": prompt},
|
| 110 |
+
{"type": "image", "image": blank_image},
|
| 111 |
+
]
|
| 112 |
+
}
|
| 113 |
+
]
|
| 114 |
+
|
| 115 |
+
inputs = processor.apply_chat_template(
|
| 116 |
+
image_messages,
|
| 117 |
+
tokenize=True,
|
| 118 |
+
add_generation_prompt=True,
|
| 119 |
+
return_tensors="pt",
|
| 120 |
+
return_dict=True,
|
| 121 |
+
padding=True,
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
inputs = {k: v.to("cuda") for k, v in inputs.items()}
|
| 125 |
+
|
| 126 |
+
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
| 127 |
+
output = model.generate(**inputs, max_new_tokens=200)
|
| 128 |
+
|
| 129 |
+
generated_tokens = output[0, inputs["input_ids"].size(1):]
|
| 130 |
+
print(processor.decode(generated_tokens, skip_special_tokens=True))
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
## License and Use
|
| 134 |
+
|
| 135 |
+
This model is licensed under Apache 2.0. It is intended for research and educational use in accordance with Ai2’s [Responsible Use Guidelines](https://allenai.org/responsible-use).
|