--- base_model: Qwen/Qwen2.5-VL-7B-Instruct library_name: peft license: apache-2.0 pipeline_tag: image-text-to-text tags: - lora - qwen2_5_vl - vision-language-model - document-understanding - receipt-extraction datasets: - sarcasticcoder/cord-extraction-lora --- # Qwen2.5-VL-7B - CORD structured-extraction LoRA QLoRA adapter that fine-tunes **Qwen/Qwen2.5-VL-7B-Instruct** to read a document image and emit structured JSON (receipt fields + line items), trained on a small CORD subset. - **Base:** `Qwen/Qwen2.5-VL-7B-Instruct` - **Method:** QLoRA (4-bit base, LoRA r=16 on the language attention/MLP layers, vision tower frozen) via Unsloth, 2 epochs on 200 CORD train receipts. - **Target:** the canonical extraction schema (doc_type, receipt fields, line items). ## Result - CORD test[:40], same pipeline, 4-bit | | Field EM | Field F1 | Line-item F1 | |---|---|---|---| | Zero-shot v3 prompt | 0.869 | 0.834 | 0.934 | | This LoRA | 0.865 | 0.830 | **0.957** | Matches the already-strong prompt baseline on fields and lifts line-item F1 +0.02. ## Usage ```python from peft import PeftModel from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor base = Qwen2_5_VLForConditionalGeneration.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct", device_map="auto") model = PeftModel.from_pretrained(base, "sarcasticcoder/qwen2.5-vl-7b-cord-lora") proc = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct") ```