gemma-4-E2B-it — kuririn_01 (LaTeX OCR)
Fine-tune of unsloth/gemma-4-E2B-it on unsloth/LaTeX_OCR (image → LaTeX).
- Method: QLoRA (r=6, alpha=6) with Unsloth Studio, checkpoint 64830
- This repo: LoRA merged into the original 16-bit (bf16) weights
Usage
from transformers import AutoProcessor, AutoModelForImageTextToText
model_id = "AtosArruda/Kuririn"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": [
{"type": "image", "image": image},
{"type": "text", "text": "Write the LaTeX representation for this image."},
]}]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256)
print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))