Image-Text-to-Text
Transformers
Safetensors
English
molmo2
multimodal
vision-language-model
embodied-reasoning
spatial-reasoning
molmo
conversational
custom_code
Instructions to use allenai/Molmo2-ER with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/Molmo2-ER with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="allenai/Molmo2-ER", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("allenai/Molmo2-ER", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use allenai/Molmo2-ER with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/Molmo2-ER" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/Molmo2-ER", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/allenai/Molmo2-ER
- SGLang
How to use allenai/Molmo2-ER with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "allenai/Molmo2-ER" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/Molmo2-ER", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "allenai/Molmo2-ER" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/Molmo2-ER", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use allenai/Molmo2-ER with Docker Model Runner:
docker model run hf.co/allenai/Molmo2-ER
Replace bf16 weights with fp32
Browse files
config.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
| 27 |
"AutoConfig": "configuration_molmo2.Molmo2Config",
|
| 28 |
"AutoModelForImageTextToText": "modeling_molmo2.Molmo2ForConditionalGeneration"
|
| 29 |
},
|
| 30 |
-
"dtype": "
|
| 31 |
"frame_end_token_id": 151944,
|
| 32 |
"frame_start_token_id": 151943,
|
| 33 |
"image_col_id": 151939,
|
|
|
|
| 27 |
"AutoConfig": "configuration_molmo2.Molmo2Config",
|
| 28 |
"AutoModelForImageTextToText": "modeling_molmo2.Molmo2ForConditionalGeneration"
|
| 29 |
},
|
| 30 |
+
"dtype": "float32",
|
| 31 |
"frame_end_token_id": 151944,
|
| 32 |
"frame_start_token_id": 151943,
|
| 33 |
"image_col_id": 151939,
|
model-00001-of-00002.safetensors → model-00001-of-00004.safetensors
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:12921633f1ff67db04516fdd37160a5b88057c1611acefb74117ea0f5dcb5773
|
| 3 |
+
size 4891799000
|
model-00002-of-00002.safetensors → model-00002-of-00004.safetensors
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb09af13aaf7a5630e7d6ecec06df670494302797d46f1ba6dacae7b7b1443fe
|
| 3 |
+
size 4844690992
|
model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1601349698c99636e1f6e09a0b96b1da5a891c3b7f0ab72bc6590fdf39ce7ca4
|
| 3 |
+
size 4844691024
|
model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30481c43be906da15fb0d8f71b9708dd19582b380699e314323d7257014c7523
|
| 3 |
+
size 4822393416
|
model.safetensors.index.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|