Pull totals, dates and line items off invoices, receipts and intake forms. Replace the formula example with scans of your own paperwork and correct transcripts.
How to run it
Commands are copied from the source, unchanged except where a notebook cell is cut at 40 lines (marked in the code). Placeholders like <you> are the source's own. Credit goes to the authors named on each block.
Install (as written in the notebook)
%%capture
import os, re
if "COLAB_" not in "".join(os.environ.keys()):
!pip install unsloth # Do this in local & cloud setups
else:
!pip install sentencepiece protobuf "datasets==4.3.0" "huggingface_hub>=0.34.0" hf_transfer
!pip install --no-deps unsloth_zoo bitsandbytes accelerate peft trl triton unsloth
!unsloth install-kernels
!pip install --no-deps --upgrade "torchao>=0.16.0"
!pip install transformers==4.57.6
!pip install --no-deps trl==0.22.2
from unsloth import FastVisionModel # FastLanguageModel for LLMs
import torch
from transformers import AutoModelForCausalLM ,AutoProcessor
# 4bit pre quantized models we support for 4x faster downloading + no OOMs.
fourbit_models = [
"unsloth/Qwen3-VL-8B-Instruct-bnb-4bit", # Qwen 3 vision support
"unsloth/Qwen3-VL-8B-Thinking-bnb-4bit",
"unsloth/Qwen3-VL-32B-Instruct-bnb-4bit",
"unsloth/Qwen3-VL-32B-Thinking-bnb-4bit",
] # More models at https://huggingface.co/unsloth
model_path = "unsloth/PaddleOCR-VL"
model, tokenizer = FastVisionModel.from_pretrained(
model_path,
max_seq_length = 2048, # Choose any for long context!
load_in_4bit = False, # 4bit uses much less memory
load_in_8bit = False, # A bit more accurate, uses 2x memory
full_finetuning = True, # We support full finetuning now!
auto_model = AutoModelForCausalLM,
trust_remote_code = True,
unsloth_force_compile = True,
)