Image-Text-to-Text
Transformers
Safetensors
English
qwen2_5_vl
multi-modal
large-language-model
conversational
text-generation-inference
Instructions to use MMR1/MMR1-Math-v0-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MMR1/MMR1-Math-v0-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MMR1/MMR1-Math-v0-7B") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("MMR1/MMR1-Math-v0-7B") model = AutoModelForMultimodalLM.from_pretrained("MMR1/MMR1-Math-v0-7B") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MMR1/MMR1-Math-v0-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MMR1/MMR1-Math-v0-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MMR1/MMR1-Math-v0-7B", "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/MMR1/MMR1-Math-v0-7B
- SGLang
How to use MMR1/MMR1-Math-v0-7B 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 "MMR1/MMR1-Math-v0-7B" \ --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": "MMR1/MMR1-Math-v0-7B", "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 "MMR1/MMR1-Math-v0-7B" \ --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": "MMR1/MMR1-Math-v0-7B", "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 MMR1/MMR1-Math-v0-7B with Docker Model Runner:
docker model run hf.co/MMR1/MMR1-Math-v0-7B
Improve model card: Correct pipeline tag, link to code, and project page
Browse filesThis PR improves the model card by:
- Correcting the `pipeline_tag` to `image-text-to-text`.
- Linking to the project page.
- Ensuring the model card has a link to the Github repository.
README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
| 1 |
---
|
| 2 |
-
library_name: transformers
|
| 3 |
-
license: apache-2.0
|
| 4 |
-
language:
|
| 5 |
-
- en
|
| 6 |
base_model:
|
| 7 |
- Qwen/Qwen2.5-VL-7B-Instruct
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
tags:
|
| 10 |
- multi-modal
|
| 11 |
- large-language-model
|
| 12 |
---
|
| 13 |
|
|
|
|
| 14 |
<p align="center">
|
| 15 |
<img src="https://github.com/LengSicong/MMR1/blob/main/assets/logo.png?raw=true" width="150" style="margin-bottom: 0.2;"/>
|
| 16 |
<p>
|
|
@@ -22,6 +23,10 @@ MMR1: Advancing the Frontiers of Multimodal Reasoning</a></h3>
|
|
| 22 |
## 📰 News
|
| 23 |
* **[2025.03.11]** 🔥🔥 Release MMR1-Math-v0, achieving SOTA with only 6k data!
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## Model Description
|
| 27 |
MMR1-Math-v0-7B is a Large Multimodal Model specialized in mathematical tasks. Remarkably, MMR1-Math-v0-7B achieves state-of-the-art performance among open-source 7B multimodal models, competing effectively even against proprietary models with significantly larger parameter sizes—all trained using only 6k carefully curated data instances.
|
|
@@ -177,4 +182,5 @@ If you find MMR1 useful for your research and applications, please cite using th
|
|
| 177 |
year={2025},
|
| 178 |
howpublished={\url{https://github.com/LengSicong/MMR1}},
|
| 179 |
}
|
|
|
|
| 180 |
```
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model:
|
| 3 |
- Qwen/Qwen2.5-VL-7B-Instruct
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
pipeline_tag: image-text-to-text
|
| 9 |
tags:
|
| 10 |
- multi-modal
|
| 11 |
- large-language-model
|
| 12 |
---
|
| 13 |
|
| 14 |
+
```markdown
|
| 15 |
<p align="center">
|
| 16 |
<img src="https://github.com/LengSicong/MMR1/blob/main/assets/logo.png?raw=true" width="150" style="margin-bottom: 0.2;"/>
|
| 17 |
<p>
|
|
|
|
| 23 |
## 📰 News
|
| 24 |
* **[2025.03.11]** 🔥🔥 Release MMR1-Math-v0, achieving SOTA with only 6k data!
|
| 25 |
|
| 26 |
+
## Links
|
| 27 |
+
Project page: https://forjadeforest.github.io/LMM-R1-ProjectPage
|
| 28 |
+
|
| 29 |
+
This model was presented in the paper [LMM-R1: Empowering 3B LMMs with Strong Reasoning Abilities Through Two-Stage Rule-Based RL](https://arxiv.org/abs/2503.07536). Code can be found at https://github.com/LengSicong/MMR1
|
| 30 |
|
| 31 |
## Model Description
|
| 32 |
MMR1-Math-v0-7B is a Large Multimodal Model specialized in mathematical tasks. Remarkably, MMR1-Math-v0-7B achieves state-of-the-art performance among open-source 7B multimodal models, competing effectively even against proprietary models with significantly larger parameter sizes—all trained using only 6k carefully curated data instances.
|
|
|
|
| 182 |
year={2025},
|
| 183 |
howpublished={\url{https://github.com/LengSicong/MMR1}},
|
| 184 |
}
|
| 185 |
+
```
|
| 186 |
```
|