Qwen3-VL-2B OCR Model
This model is a fine-tuned version of Qwen3-VL-2B, optimized for Hindi OCR. It is trained on the iamkushagratomar/devanagari-ocr-synthetic-80k dataset to recognize and extract Hindi text from images.
🔧 How to Use
Install dependencies:
pip install -q -U unsloth unsloth_zooImports:
import unsloth from unsloth import FastVisionModel import torch from PIL import ImageLoad the model:
TEST_IMAGE_PATH = "/content/image.jpg" INSTRUCTION = "Read all the text in this image and transcribe it exactly." inference_model, inference_processor = FastVisionModel.from_pretrained( "iamkushagratomar/Qwen3VL-2B-OCR", load_in_4bit=True, ) FastVisionModel.for_inference(inference_model)Use the model::
image = Image.open(TEST_IMAGE_PATH).convert("RGB") text_prompt = inference_processor.apply_chat_template( [ {"role": "user", "content": [ {"type": "image", "image": image}, {"type": "text", "text": INSTRUCTION}, ]} ], tokenize=False, add_generation_prompt=True ) inputs = inference_processor( text=[text_prompt], images=[image], padding=True, return_tensors="pt").to(inference_model.device) with torch.no_grad(): output_ids = inference_model.generate(**inputs, max_new_tokens=512) # Example usage trimmed = output_ids[:, inputs["input_ids"].shape[1]:] result = inference_processor.batch_decode( trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0] print("OCR OUTPUT:", result)
Uploaded finetuned model
- Developed by: iamkushagratomar
- License: apache-2.0
- Finetuned from model : unsloth/Qwen3-VL-2B-Instruct-unsloth-bnb-4bit
This qwen3_vl model was trained 2x faster with Unsloth