Image-Text-to-Text
PEFT
Safetensors
document-classification
vision-language
lora
unsloth
conversational
Instructions to use asim-salim/gemma-4-e4b-doc-classifier-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use asim-salim/gemma-4-e4b-doc-classifier-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-E4B-it") model = PeftModel.from_pretrained(base_model, "asim-salim/gemma-4-e4b-doc-classifier-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use asim-salim/gemma-4-e4b-doc-classifier-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 asim-salim/gemma-4-e4b-doc-classifier-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 asim-salim/gemma-4-e4b-doc-classifier-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for asim-salim/gemma-4-e4b-doc-classifier-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="asim-salim/gemma-4-e4b-doc-classifier-lora", max_seq_length=2048, )
Gemma 4 E4B — Document Classifier (LoRA)
LoRA adapter finetuned from google/gemma-4-E4B-it for single-page document
classification and identity-field extraction from scanned/faxed financial documents.
Classes
bank_statement, drivers_license, monthly_bill, paystub, state_id, unknown
Output format
{"schema_object_wrapper": [{"cls": "", "confidence": 0.0, "issuer": "", "holder": "", "page_marker": ""}]}
Usage
from unsloth import FastVisionModel
model, processor = FastVisionModel.from_pretrained("asim-salim/gemma-4-e4b-doc-classifier-lora")
FastVisionModel.for_inference(model)
Adapter: 147 MB LoRA over google/gemma-4-E4B-it. Trained with unsloth + TRL (PEFT 0.19.1).
License
Governed by the Gemma Terms of Use and the Gemma Prohibited Use Policy.
Limitations
Trained on a specific document corpus; not evaluated for general-purpose document understanding. Outputs must not be treated as authoritative for financial decisions.
- Downloads last month
- 29