Image-Text-to-Text
Transformers
Safetensors
molmo_olmo3
molmo
vision-language-model
olmo3
conversational
custom_code
Instructions to use amitha/molmo-clip-b16-olmo3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amitha/molmo-clip-b16-olmo3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="amitha/molmo-clip-b16-olmo3", 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("amitha/molmo-clip-b16-olmo3", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amitha/molmo-clip-b16-olmo3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amitha/molmo-clip-b16-olmo3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amitha/molmo-clip-b16-olmo3", "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/amitha/molmo-clip-b16-olmo3
- SGLang
How to use amitha/molmo-clip-b16-olmo3 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 "amitha/molmo-clip-b16-olmo3" \ --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": "amitha/molmo-clip-b16-olmo3", "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 "amitha/molmo-clip-b16-olmo3" \ --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": "amitha/molmo-clip-b16-olmo3", "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 amitha/molmo-clip-b16-olmo3 with Docker Model Runner:
docker model run hf.co/amitha/molmo-clip-b16-olmo3
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
tags:
|
| 6 |
+
- molmo
|
| 7 |
+
- vision-language-model
|
| 8 |
+
- olmo3
|
| 9 |
+
base_model:
|
| 10 |
+
- allenai/OLMo-3-1025-7B
|
| 11 |
+
- amitha/clip-vit-b16-datacomp-medium
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# amitha/molmo-clip-b16-olmo3
|
| 15 |
+
|
| 16 |
+
A Molmo-style vision-language model: a **frozen CLIP ViT-B/16** vision encoder
|
| 17 |
+
(pretrained on **DataComp-medium**, from [`amitha/clip-vit-b16-datacomp-medium`](https://huggingface.co/amitha/clip-vit-b16-datacomp-medium))
|
| 18 |
+
+ a trained multimodal connector + the **[OLMo-3-7B](https://huggingface.co/allenai/OLMo-3-1025-7B)**
|
| 19 |
+
language model (`Olmo3ForCausalLM`).
|
| 20 |
+
|
| 21 |
+
The vision encoder was **frozen** during training; only the connector (a SwiGLU image
|
| 22 |
+
projector + a CLS projector) and the language model were trained, following the Molmo recipe.
|
| 23 |
+
|
| 24 |
+
> **Vision weights are referenced, not stored.** This repo ships the connector + LLM weights
|
| 25 |
+
> only. The vision tower is loaded at runtime from [`amitha/clip-vit-b16-datacomp-medium`](https://huggingface.co/amitha/clip-vit-b16-datacomp-medium),
|
| 26 |
+
> so that repo must remain accessible. Loading requires `trust_remote_code=True`.
|
| 27 |
+
|
| 28 |
+
## Checkpoints
|
| 29 |
+
|
| 30 |
+
Training ran for 4 epochs. The **repo root is the final checkpoint** (`step14392`, 4 epochs).
|
| 31 |
+
Three earlier checkpoints are available as subfolders:
|
| 32 |
+
|
| 33 |
+
| Checkpoint | Subfolder | Notes |
|
| 34 |
+
|---|---|---|
|
| 35 |
+
| `step14392` | *(root)* | final (4 epochs) |
|
| 36 |
+
| `step7196` | `step7196` | 2 epochs |
|
| 37 |
+
| `step13000` | `step13000` | ~3.6 epochs |
|
| 38 |
+
| `step14000` | `step14000` | ~3.9 epochs |
|
| 39 |
+
|
| 40 |
+
Load an earlier checkpoint with `subfolder=`:
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
| 44 |
+
"amitha/molmo-clip-b16-olmo3", subfolder="step13000", trust_remote_code=True)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Usage
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
import torch, PIL.Image, requests
|
| 51 |
+
from transformers import AutoModelForImageTextToText, AutoTokenizer
|
| 52 |
+
from transformers import AutoImageProcessor, AutoProcessor
|
| 53 |
+
|
| 54 |
+
repo = "amitha/molmo-clip-b16-olmo3"
|
| 55 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
| 56 |
+
repo, trust_remote_code=True, dtype=torch.float32).eval()
|
| 57 |
+
processor = AutoProcessor.from_pretrained(repo, trust_remote_code=True)
|
| 58 |
+
|
| 59 |
+
image = PIL.Image.open(requests.get(
|
| 60 |
+
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg",
|
| 61 |
+
stream=True).raw).convert("RGB")
|
| 62 |
+
inputs = processor(text="Describe this image in detail.", images=[image], return_tensors="pt")
|
| 63 |
+
|
| 64 |
+
with torch.no_grad():
|
| 65 |
+
out = model.generate(**inputs, max_new_tokens=200, do_sample=False)
|
| 66 |
+
print(processor.tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
### Prompt styles
|
| 70 |
+
|
| 71 |
+
The model was trained with several caption/QA styles. The processor exposes an optional
|
| 72 |
+
`style` argument (default: none) that prepends a `"{style}: "` prefix matching training:
|
| 73 |
+
|
| 74 |
+
```python
|
| 75 |
+
inputs = processor(text="Describe this image.", images=[image],
|
| 76 |
+
style="long_caption", return_tensors="pt")
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
Known styles: `long_caption`, `transcript`, `user_qa`, `synthetic_qa`.
|
| 80 |
+
|
| 81 |
+
## Architecture notes
|
| 82 |
+
|
| 83 |
+
- **Image tokens:** single 224×224 crop, no pooling, CLS token included → 197 image tokens
|
| 84 |
+
(1 CLS + 196 patches) inserted into the text stream.
|
| 85 |
+
- **LLM:** native `Olmo3ForCausalLM` (post-norm, YaRN RoPE), vocabulary padded to 100480;
|
| 86 |
+
the 128 image-placeholder logits are masked during generation.
|
| 87 |
+
- **Image preprocessing:** resize so the short side is 224 (bicubic), center-crop 224,
|
| 88 |
+
normalize with OpenAI CLIP statistics.
|
| 89 |
+
|
| 90 |
+
## Provenance
|
| 91 |
+
|
| 92 |
+
Converted from native Molmo training checkpoints to the HuggingFace format with a converter
|
| 93 |
+
verified to reproduce the original Molmo inference **bit-for-bit** (identical input ids and
|
| 94 |
+
image token layout; vision features and logits matching to floating-point ordering noise;
|
| 95 |
+
identical greedy generations).
|