Downloads · 30 days
0
GRAI-UNSTPB/Qwen2-VL-7B-Instruct-RoVQA-lora-v1
Qwen2-VL-7B-Instruct-RoVQA-lora-v1 is a image-to-text model from GRAI-UNSTPB. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as apache-2.0.
This is a parameter-efficient Low-Rank Adaptation (LoRA) adapter for Qwen2-VL-7B-Instruct fine-tuned on Romanian Visual Question Answering (VQA).
Downloads · 30 days
0
Access
Public
Updated Jul 5, 2026
Repo size
162 MB
Likes
0
Public
Click a slice to open those files.
.safetensors162 MB · 100%
From the Hugging Face model README
This is a parameter-efficient Low-Rank Adaptation (LoRA) adapter for Qwen2-VL-7B-Instruct fine-tuned on Romanian Visual Question Answering (VQA).
It was trained on the GRAI-UNSTPB/Flickr30K-RoQA-v1 dataset using Unsloth and Hugging Face's TRL library.
You can load and run inference on this model either using Unsloth (for 2x faster inference) or standard Hugging Face transformers and peft.
pip install torch transformers peft pillow datasets qwen-vl-utils
# If you want to use Unsloth for faster inference, install it via:
# pip install unsloth
from unsloth import FastVisionModel
import torch
from datasets import load_dataset
# Load model and processor
model, processor = FastVisionModel.from_pretrained(
model_name="GRAI-UNSTPB/Qwen2-VL-7B-Instruct-RoVQA-lora-v1",
load_in_4bit=True
)
FastVisionModel.for_inference(model)
# Load a test sample directly from the Flickr30K-RoQA-v1 dataset
dataset = load_dataset("GRAI-UNSTPB/Flickr30K-RoQA-v1", split="test")
sample = dataset[0]
image = sample["image"]
question = sample["question"]
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": f"Răspunde la întrebare: {question}"}
]
}
]
input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
inputs = processor(images=image, text=input_text, return_tensors="pt").to("cuda")
# Generate response
outputs = model.generate(**inputs, max_new_tokens=64)
# Decode only the generated response (excluding the prompt)
prompt_len = inputs.input_ids.shape[1]
response = processor.decode(outputs[0][prompt_len:], skip_special_tokens=True)
print(response)
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
from peft import PeftModel
import torch
from PIL import Image
# Load base model and processor
base_model_id = "unsloth/qwen2-vl-7b-instruct-unsloth-bnb-4bit"
processor = AutoProcessor.from_pretrained(base_model_id)
model = Qwen2VLForConditionalGeneration.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(model, "GRAI-UNSTPB/Qwen2-VL-7B-Instruct-RoVQA-lora-v1")
# Inference setup follows the same structure as above...
The model was evaluated on the Flickr30K-RoQA test set and on Romanian Image Captioning (zero-shot transfer task without captioning fine-tuning).
| Model | BERTScore F1 (%) | ROUGE-L F1 (%) | BLEU |
|---|---|---|---|
| Qwen2-VL-7B-Instruct (Base) | 75.09 | 45.14 | 14.30 |
| Qwen2-VL-7B-Instruct + RoVQA LoRA (Ours) | 77.38 | 53.54 | 34.79 |
| Model | BERTScore F1 (%) | ROUGE-L F1 (%) | BLEU |
|---|---|---|---|
| Qwen2-VL-7B-Instruct (Base) | 67.50 | 28.07 | 7.18 |
| Qwen2-VL-7B-Instruct + RoVQA LoRA (Ours) | 71.95 | 37.74 | 14.94 |
If you use this model or adapter in your research, please cite the following paper:
@article{dima2025parameter,
title={Parameter-Efficient Multimodal Instruction Tuning for Romanian Vision--Language Models},
author={Dima, George-Andrei and Smădu, Răzvan-Alexandru and Cercel, Dumitru-Clementin},
journal={arXiv preprint arXiv:2512.14926},
year={2025}
}