Downloads · 30 days
14
5% of all-time downloads
Manh1011/Qwen2.5-VL-3B-GRPO-Thinking
Qwen2.5-VL-3B-GRPO-Thinking is a image-text-to-text model from Manh1011. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
The Qwen2.5-VL-3B-GRPO-Thinking is a multi-modal Vision-Language Model (VLM) capable of processing both images and text. This version is fine-tuned from the foundational Qwen2.5-VL-3B using the GRPO (Group Relative Po…
Downloads · 30 days
14
5% of all-time downloads
All-time downloads
278
Public
Parameters
3.8B
7.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors7.5 GB · 100%
From the Hugging Face model README
The Qwen2.5-VL-3B-GRPO-Thinking is a multi-modal Vision-Language Model (VLM) capable of processing both images and text. This version is fine-tuned from the foundational Qwen2.5-VL-3B using the GRPO (Group Relative Policy Optimization) reinforcement learning algorithm. The primary goal of this fine-tuning is to equip the model with enhanced logical reasoning and a step-by-step "thinking process" to solve complex tasks more accurately before providing the final answer.
This model retains the excellent visual perception capabilities of the Qwen2.5-VL ecosystem (including object detection, OCR, chart analysis, and dense image understanding). The key differentiator is that it has been trained to prioritize generating intermediate analytical steps (Chain-of-Thought) before formulating the final response.
Users should be aware of these limitations. A "Human-in-the-loop" approach is strongly recommended when dealing with sensitive data or critical information extraction.
Make sure you have the latest version of the transformers library installed. Use the code below to load and run the model:
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
import torch
# 1. Initialize model and processor
model_id = "Manh1011/Qwen2.5-VL-3B-GRPO-Thinking"
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)
# 2. Prepare multi-modal inputs
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "[https://example.com/image.jpg](https://example.com/image.jpg)"}, # Replace with actual image URL
{"type": "text", "text": "Carefully analyze this image and explain step-by-step what is happening."}
]
}
]
# 3. Process the data
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(
text=[text],
images=["[https://example.com/image.jpg](https://example.com/image.jpg)"],
return_tensors="pt",
padding=True
).to(model.device)
# 4. Generate Output (Inference)
generated_ids = model.generate(**inputs, max_new_tokens=1024)
generated_ids_trimmed = [
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text[0])