Downloads · 30 days
9
5% of all-time downloads
salihfurkaan/Qwen2.5-VL-ScienceQA-Math-CoT-Merged
Qwen2.5-VL-ScienceQA-Math-CoT-Merged is a machine learning model from salihfurkaan. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This model is a fine-tuned vision-language architecture optimized for scientific reasoning, mathematical problem-solving, and Chain-of-Thought (CoT) generation. It is the fully merged version of the base model and its…
Downloads · 30 days
9
5% of all-time downloads
All-time downloads
183
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
This model is a fine-tuned vision-language architecture optimized for scientific reasoning, mathematical problem-solving, and Chain-of-Thought (CoT) generation. It is the fully merged version of the base model and its LoRA adapter. I integrated the adapter weights directly into the base parameters to allow for standalone execution without needing to load PEFT modules dynamically at runtime.
Qwen/Qwen2.5-VL-3B-Instructbfloat16This model processes visual inputs like charts, diagrams, and scientific figures, generating step-by-step reasoning paths before outputting a final answer. It relies on the ScienceQA dataset structures to enforce logic.
This is not a generalized conversational agent, it is a highly specialized reasoning tool. You should double-check its mathematical outputs. Even with CoT enforcement, autoregressive generation can occasionally yield arithmetic hallucinations on complex edge cases.
You can run this model directly using standard transformers libraries. Loading it in bfloat16 is recommended to prevent VRAM overhead and maintain precision integrity.
import torch
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
from PIL import Image
import requests
model_id = "salihfurkaan/Qwen2.5-VL-ScienceQA-Math-CoT-Merged"
# 1. Load processor and model
processor = AutoProcessor.from_pretrained(model_id)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# 2. Prepare the visual and text inputs
url = "[https://example.com/sample_physics_diagram.jpg](https://example.com/sample_physics_diagram.jpg)"
image = Image.open(requests.get(url, stream=True).raw)
prompt = "Analyze the provided diagram. Think step-by-step and calculate the final velocity."
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": prompt}
]
}
]
# 3. Process inputs
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], images=[image], return_tensors="pt", padding=True).to("cuda")
# 4. Generate the CoT response
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 = processor.batch_decode(generated_ids_trimmed, skip_special_tokens=True)
print(output[0])
The fine-tuning process utilized Low-Rank Adaptation (LoRA) to efficiently update the model's attention weights without altering the base Qwen2.5-VL parameters. The adapter was subsequently merged to reduce inference latency and simplify deployment pipelines.
peft, transformers, accelerate, torchaoPeftModel.merge_and_unload()bfloat16 to prevent precision degradation and maintain numerical stability.To ensure stable execution and avoid Out-Of-Memory (OOM) errors, your deployment environment must meet the following criteria:
bfloat16 precision.transformers >= 4.45.0 is installed.If you utilize this model in your research or autonomous backend architecture, please cite it as follows:
@misc{erik2026qwen25vlcot,
author = {salih furkan erik},
title = {Qwen2.5-VL-3B-ScienceQA-Math-CoT: A Merged Vision-Language Adapter for Scientific Reasoning},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/salihfurkaan/Qwen2.5-VL-3B-ScienceQA-Math-CoT](https://huggingface.co/salihfurkaan/Qwen2.5-VL-3B-ScienceQA-Math-CoT)}}
}