Instructions to use chai1me/qwen2vl-receipt-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use chai1me/qwen2vl-receipt-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2-VL-2B-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "chai1me/qwen2vl-receipt-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use chai1me/qwen2vl-receipt-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for chai1me/qwen2vl-receipt-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for chai1me/qwen2vl-receipt-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for chai1me/qwen2vl-receipt-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="chai1me/qwen2vl-receipt-lora", max_seq_length=2048, )
Qwen2-VL-2B Receipt Extraction (LoRA)
LoRA adapter fine-tuning Qwen2-VL-2B-Instruct to extract structured JSON (line items and total) from receipt images. Trained with QLoRA (4-bit) on a single Kaggle T4 GPU.
Results (60 held-out receipts, unseen during training)
| Metric | Score |
|---|---|
| Valid JSON output | 100% |
| Total exact-match | 90% |
| Mean char-similarity on near-misses | 0.957 |
Training
- Base:
Qwen/Qwen2-VL-2B-Instruct(loaded 4-bit viaunsloth/Qwen2-VL-2B-Instruct-bnb-4bit) - Method: LoRA on ~0.8% of parameters (language + attention + MLP layers), vision encoder frozen
- Config: 2 epochs, effective batch size 8, learning rate 2e-4
- Data: CORD-v2, 400 train / 60 validation
Usage
from unsloth import FastVisionModel
model, tokenizer = FastVisionModel.from_pretrained("chai1me/qwen2vl-receipt-lora", load_in_4bit=True)
FastVisionModel.for_inference(model)
Limitations
Trained on café/restaurant receipts (CORD). Other document types need retraining. Field extraction only; not a forgery- or tamper-detection system.
Full code and evaluation: GitHub
- Downloads last month
- 11
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support