Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,123 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
base_model:
|
6 |
+
- openai/clip-vit-large-patch14-336
|
7 |
+
- Qwen/Qwen2-7B
|
8 |
+
pipeline_tag: image-text-to-text
|
9 |
+
tags:
|
10 |
+
- multimodal
|
11 |
+
---
|
12 |
+
|
13 |
+
<img src="molmo_logo.png" alt="Logo for the Molmo Project" style="width: auto; height: 50px;">
|
14 |
+
|
15 |
+
# Molmo 7B-D
|
16 |
+
|
17 |
+
Molmo is a family of open vision-language models developed by the Allen Institute for AI.
|
18 |
+
Molmo models are trained on PixMo, a dataset of 1 million, highly-curated image-text pairs.
|
19 |
+
It has state-of-the-art performance among multimodal models with a similar size while being fully open-source.
|
20 |
+
You can find all models in the Molmo family [here](https://huggingface.co/collections/allenai/molmo-66f379e6fe3b8ef090a8ca19).
|
21 |
+
**Learn more** about the Molmo family [in our announcement blog post](https://molmo.allenai.org/blog).
|
22 |
+
|
23 |
+
Molmo 7B-O is based on [OLMo-7B-1124]() (to be released) and uses [OpenAI CLIP](https://huggingface.co/openai/clip-vit-large-patch14-336) as vision backbone.
|
24 |
+
It performs comfortably between GPT-4V and GPT-4o on both academic benchmarks and human evaluation.
|
25 |
+
|
26 |
+
This checkpoint is a **preview** of the Molmo release. All artifacts used in creating Molmo (PixMo dataset, training code, evaluations, intermediate checkpoints) will be made available at a later date, furthering our commitment to open-source AI development and reproducibility.
|
27 |
+
|
28 |
+
[**Sign up here**](https://docs.google.com/forms/d/e/1FAIpQLSdML1MhNNBDsCHpgWG65Oydg2SjZzVasyqlP08nBrWjZp_c7A/viewform) to be the first to know when artifacts are released.
|
29 |
+
|
30 |
+
## Quick Start
|
31 |
+
|
32 |
+
To run Molmo, first install dependencies:
|
33 |
+
|
34 |
+
```bash
|
35 |
+
pip install einops tensorflow torchvision
|
36 |
+
```
|
37 |
+
|
38 |
+
Then, follow these steps:
|
39 |
+
|
40 |
+
```python
|
41 |
+
from transformers import AutoModelForCausalLM, AutoProcessor, GenerationConfig
|
42 |
+
from PIL import Image
|
43 |
+
import requests
|
44 |
+
|
45 |
+
# load the processor
|
46 |
+
processor = AutoProcessor.from_pretrained(
|
47 |
+
'allenai/Molmo-7B-O-0924',
|
48 |
+
trust_remote_code=True,
|
49 |
+
torch_dtype='auto',
|
50 |
+
device_map='auto'
|
51 |
+
)
|
52 |
+
|
53 |
+
# load the model
|
54 |
+
model = AutoModelForCausalLM.from_pretrained(
|
55 |
+
'allenai/Molmo-7B-O-0924',
|
56 |
+
trust_remote_code=True,
|
57 |
+
torch_dtype='auto',
|
58 |
+
device_map='auto'
|
59 |
+
)
|
60 |
+
|
61 |
+
# process the image and text
|
62 |
+
inputs = processor.process(
|
63 |
+
images=[Image.open(requests.get("https://picsum.photos/id/237/536/354", stream=True).raw)],
|
64 |
+
text="Describe this image."
|
65 |
+
)
|
66 |
+
|
67 |
+
# move inputs to the correct device and make a batch of size 1
|
68 |
+
inputs = {k: v.to(model.device).unsqueeze(0) for k, v in inputs.items()}
|
69 |
+
|
70 |
+
# generate output; maximum 200 new tokens; stop generation when <|endoftext|> is generated
|
71 |
+
output = model.generate_from_batch(
|
72 |
+
inputs,
|
73 |
+
GenerationConfig(max_new_tokens=200, stop_strings="<|endoftext|>"),
|
74 |
+
tokenizer=processor.tokenizer
|
75 |
+
)
|
76 |
+
|
77 |
+
# only get generated tokens; decode them to text
|
78 |
+
generated_tokens = output[0,inputs['input_ids'].size(1):]
|
79 |
+
generated_text = processor.tokenizer.decode(generated_tokens, skip_special_tokens=True)
|
80 |
+
|
81 |
+
# print the generated text
|
82 |
+
print(generated_text)
|
83 |
+
|
84 |
+
# >>> This photograph captures an adorable black Labrador puppy sitting on a weathered
|
85 |
+
# wooden deck. The deck's planks, which are a mix of light and dark brown with ...
|
86 |
+
```
|
87 |
+
|
88 |
+
## Evaluations
|
89 |
+
|
90 |
+
| Model | Average Score on 11 Academic Benchmarks | Human Preference Elo Rating |
|
91 |
+
|-----------------------------|-----------------------------------------|-----------------------------|
|
92 |
+
| Molmo 72B | 81.2 | 1077 |
|
93 |
+
| Molmo 7B-D | 77.3 | 1056 |
|
94 |
+
| **Molmo 7B-O (this model)** | **74.6** | **1051** |
|
95 |
+
| MolmoE 1B | 68.6 | 1032 |
|
96 |
+
| GPT-4o | 78.5 | 1079 |
|
97 |
+
| GPT-4V | 71.1 | 1041 |
|
98 |
+
| Gemini 1.5 Pro | 78.3 | 1074 |
|
99 |
+
| Gemini 1.5 Flash | 75.1 | 1054 |
|
100 |
+
| Claude 3.5 Sonnet | 76.7 | 1069 |
|
101 |
+
| Claude 3 Opus | 66.4 | 971 |
|
102 |
+
| Claude 3 Haiku | 65.3 | 999 |
|
103 |
+
| Qwen VL2 72B | 79.4 | 1037 |
|
104 |
+
| Qwen VL2 7B | 73.7 | 1025 |
|
105 |
+
| Intern VL2 LLAMA 76B | 77.1 | 1018 |
|
106 |
+
| Intern VL2 8B | 69.4 | 953 |
|
107 |
+
| Pixtral 12B | 69.5 | 1016 |
|
108 |
+
| Phi3.5-Vision 4B | 59.7 | 982 |
|
109 |
+
| PaliGemma 3B | 50.0 | 937 |
|
110 |
+
| LLAVA OneVision 72B | 76.6 | 1051 |
|
111 |
+
| LLAVA OneVision 7B | 72.0 | 1024 |
|
112 |
+
| Cambrian-1 34B | 66.8 | 953 |
|
113 |
+
| Cambrian-1 8B | 63.4 | 952 |
|
114 |
+
| xGen - MM - Interleave 4B | 59.5 | 979 |
|
115 |
+
| LLAVA-1.5 13B | 43.9 | 960 |
|
116 |
+
| LLAVA-1.5 7B | 40.7 | 951 |
|
117 |
+
|
118 |
+
*Benchmarks: AI2D test, ChartQA test, VQA v2.0 test, DocQA test, InfographicVQA test, TextVQA val, RealWorldQA, MMMU val, MathVista testmini, CountBenchQA, Flickr Count (we collected this new dataset that is significantly harder than CountBenchQA).*
|
119 |
+
|
120 |
+
## License and Use
|
121 |
+
|
122 |
+
This model is licensed under Apache 2.0. It is intended for research and educational use.
|
123 |
+
For more information, please see our [Responsible Use Guidelines](https://allenai.org/responsible-use).
|