naver-clova-ix/cord-v2
Viewer β’ Updated β’ 1k β’ 9.26k β’ 124
How to use saliousk/qwen2vl-cord-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-VL-7B-Instruct")
model = PeftModel.from_pretrained(base_model, "saliousk/qwen2vl-cord-lora")A QLoRA adapter fine-tuning Qwen2-VL-7B-Instruct for structured JSON extraction from receipt photos, trained on CORD-v2.
Part of the edge-vlm-extraction project β a methodology for fine-tuning and honestly measuring a vision-language model under edge hardware constraints.
| Metric | Base model | Fine-tuned | Ξ |
|---|---|---|---|
| Valid JSON rate | 7.5% | 100% | +92.5 pts |
| Field exact-match | 0% | 6.2% | +6.2 pts |
| Menu-item recall | 0% | 7.5% | +7.5 pts |
Reading the numbers honestly. The jump to 100% valid JSON is the core result. Field exact-match and recall remain low because 3 epochs on 600 examples teaches structure, not value memorisation. Both numbers are reported deliberately.
Training dynamics. Loss: 1.69 β 0.16 over 220 steps. Under 45 min on RTX 4090.
from peft import PeftModel
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
base = Qwen2VLForConditionalGeneration.from_pretrained(
"Qwen/Qwen2-VL-7B-Instruct", torch_dtype="auto", device_map="auto")
model = PeftModel.from_pretrained(base, "saliousk/qwen2vl-cord-lora")
processor = AutoProcessor.from_pretrained("saliousk/qwen2vl-cord-lora")