Downloads · 30 days
6
6% of all-time downloads
hxcsa/qwen35-4b-docvqa-lora
qwen35-4b-docvqa-lora is a machine learning model from hxcsa. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
LoRA adapters fine-tuning Qwen/Qwen3.5-4B for document visual question answering. Trained with Unsloth on 2,000 curated DocVQA samples from the train split.
Downloads · 30 days
6
6% of all-time downloads
All-time downloads
100
Public
Repo size
202 MB
Likes
0
Public
Click a slice to open those files.
.safetensors170 MB · 89%
From the Hugging Face model README
LoRA adapters fine-tuning Qwen/Qwen3.5-4B for document visual question answering. Trained with Unsloth on 2,000 curated DocVQA samples from the train split.
from unsloth import FastVisionModel
from peft import PeftModel
base, processor = FastVisionModel.from_pretrained("Qwen/Qwen3.5-4B", load_in_4bit=True)
FastVisionModel.for_inference(base)
model = PeftModel.from_pretrained(base, "hxcsa/qwen35-4b-docvqa-lora")
FastVisionModel.for_inference(model)
# Qwen3.5 is a thinking-style model — disable thinking for concise answers
text = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=False,
enable_thinking=False, # ← essential
)
inputs = processor(images=image, text=text, add_special_tokens=False, return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
answer = processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip()
| Model | ANLS | Exact Match |
|---|---|---|
| Qwen3.5-4B base (zero-shot) | 0.6265 | 0.5933 |
| v1 LoRA (1k from val, contaminated) | 0.8626 | 0.8333 |
| v2 r16 attn-only (2k train, 2 epochs) | 0.8687 | 0.8567 |
| v2 r32 + MLP (2k train, 2 epochs) | 0.8833 | 0.8667 |
+0.26 ANLS over zero-shot. Clean eval (trained on train, tested on val).
Trained on hxcsa/docvqa-2k-train (2,000 samples from DocVQA train split,
quality-filtered, 1344px max edge). The validation ANLS uses the clean
DocVQA validation split.
adapter_model.safetensors — LoRA weights (34 MB)tokenizer.json / tokenizer_config.json / chat_template.jinja — Qwen3.5 templateprocessor_config.json — vision processor config