Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
vision-language-model
reinforcement-learning
grpo
metaphor-understanding
visual-reasoning
conversational
text-generation-inference
Instructions to use MING-ZCH/MetaphorStar-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MING-ZCH/MetaphorStar-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MING-ZCH/MetaphorStar-3B") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("MING-ZCH/MetaphorStar-3B") model = AutoModelForImageTextToText.from_pretrained("MING-ZCH/MetaphorStar-3B") 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 MING-ZCH/MetaphorStar-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MING-ZCH/MetaphorStar-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MING-ZCH/MetaphorStar-3B", "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/MING-ZCH/MetaphorStar-3B
- SGLang
How to use MING-ZCH/MetaphorStar-3B 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 "MING-ZCH/MetaphorStar-3B" \ --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": "MING-ZCH/MetaphorStar-3B", "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 "MING-ZCH/MetaphorStar-3B" \ --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": "MING-ZCH/MetaphorStar-3B", "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 MING-ZCH/MetaphorStar-3B with Docker Model Runner:
docker model run hf.co/MING-ZCH/MetaphorStar-3B
Add pipeline tag and external links
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,17 +1,21 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
library_name: transformers
|
|
|
|
|
|
|
|
|
|
| 4 |
tags:
|
| 5 |
- vision-language-model
|
| 6 |
- reinforcement-learning
|
| 7 |
- grpo
|
| 8 |
- metaphor-understanding
|
| 9 |
- visual-reasoning
|
| 10 |
-
base_model: Qwen/Qwen2.5-VL
|
| 11 |
---
|
| 12 |
|
| 13 |
# MetaphorStar: Image Metaphor Understanding and Reasoning with End-to-End Visual RL
|
| 14 |
|
|
|
|
|
|
|
| 15 |
**MetaphorStar** is the first Multi-modal Large Language Model (MLLM) family trained via an **End-to-End Visual Reinforcement Learning (RL)** framework specifically designed to bridge the gap between literal perception ("seeing things as they are") and metaphorical understanding ("seeing things as we are").
|
| 16 |
|
| 17 |
Built upon the Qwen2.5-VL architecture, MetaphorStar achieves State-of-the-Art (SOTA) performance on image implication tasks and demonstrates robust generalization capabilities on complex visual reasoning benchmarks (e.g., MMMU, MathVerse).
|
|
@@ -65,7 +69,9 @@ messages = [
|
|
| 65 |
"role": "user",
|
| 66 |
"content": [
|
| 67 |
{"type": "image", "image": "path/to/metaphor_image.jpg"},
|
| 68 |
-
{"type": "text", "text": "True-false questions: The wilted plant in the office implies a stressful working environment.
|
|
|
|
|
|
|
| 69 |
]
|
| 70 |
}
|
| 71 |
]
|
|
@@ -85,7 +91,7 @@ print(output_text)
|
|
| 85 |
@article{metaphorstar2026,
|
| 86 |
title={MetaphorStar: Image Metaphor Understanding and Reasoning with End-to-End Visual Reinforcement Learning},
|
| 87 |
author={Chenhao Zhang, Yazhe Niu, Hongsheng Li},
|
| 88 |
-
journal={
|
| 89 |
year={2026}
|
| 90 |
}
|
| 91 |
```
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: Qwen/Qwen2.5-VL
|
| 3 |
library_name: transformers
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
arxiv: 2602.10575
|
| 7 |
tags:
|
| 8 |
- vision-language-model
|
| 9 |
- reinforcement-learning
|
| 10 |
- grpo
|
| 11 |
- metaphor-understanding
|
| 12 |
- visual-reasoning
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# MetaphorStar: Image Metaphor Understanding and Reasoning with End-to-End Visual RL
|
| 16 |
|
| 17 |
+
[**Paper**](https://huggingface.co/papers/2602.10575) | [**Project Page**](https://metaphorstar.github.io) | [**GitHub**](https://github.com/MING-ZCH/MetaphorStar)
|
| 18 |
+
|
| 19 |
**MetaphorStar** is the first Multi-modal Large Language Model (MLLM) family trained via an **End-to-End Visual Reinforcement Learning (RL)** framework specifically designed to bridge the gap between literal perception ("seeing things as they are") and metaphorical understanding ("seeing things as we are").
|
| 20 |
|
| 21 |
Built upon the Qwen2.5-VL architecture, MetaphorStar achieves State-of-the-Art (SOTA) performance on image implication tasks and demonstrates robust generalization capabilities on complex visual reasoning benchmarks (e.g., MMMU, MathVerse).
|
|
|
|
| 69 |
"role": "user",
|
| 70 |
"content": [
|
| 71 |
{"type": "image", "image": "path/to/metaphor_image.jpg"},
|
| 72 |
+
{"type": "text", "text": "True-false questions: The wilted plant in the office implies a stressful working environment.
|
| 73 |
+
|
| 74 |
+
First, describe the image, then analyze the image implication, and finally reason to get the answer. Output the thinking process in <think></think> and the final correct answer in <answer></answer> tags."}
|
| 75 |
]
|
| 76 |
}
|
| 77 |
]
|
|
|
|
| 91 |
@article{metaphorstar2026,
|
| 92 |
title={MetaphorStar: Image Metaphor Understanding and Reasoning with End-to-End Visual Reinforcement Learning},
|
| 93 |
author={Chenhao Zhang, Yazhe Niu, Hongsheng Li},
|
| 94 |
+
journal={arXiv preprint arXiv:2602.10575},
|
| 95 |
year={2026}
|
| 96 |
}
|
| 97 |
```
|