deepseek-ocr-2-urdu-ocr-1m-lora
1
license:apache-2.0
by
kingabzpro
Language Model
OTHER
New
0 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
Usagepythontransformers
import torch
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
MODEL_ID = "kingabzpro/deepseek-ocr-2-urdu-ocr-1m-lora"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoPeftModelForCausalLM.from_pretrained(
MODEL_ID,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
use_safetensors=True,
_attn_implementation="flash_attention_2",
)
model = model.eval().cuda()
model.config.use_cache = True
prompt = "<image>\nFree OCR. "
result = model.infer(
tokenizer,
prompt=prompt,
image_file="sample.png",
output_path="ocr-output",
base_size=1024,
image_size=768,
crop_mode=True,
save_results=False,
eval_mode=True,
)
print(result)Resultstext
sample_index: 21
reference : آنے والے شخص نے اپنا تعارف کرواتے ہوئے کہا:”میرا نام شہزاد ہے۔
before : ۱- وله شخص از پشت رفت و آمد و به "میرادام" بشارد.
after : آئے والے شخص نے اپنا تعارف کرواتے ہوئے کہا: ”میں ہام شہزاد ہے۔
sample_index: 53
reference : آپﷺ نے فرمایا کہ اے انجشہ!
before : 1 - في كتابة النص، هل تسبيماً ماكسراً؟ اكتب ثابتاً!
after : آپ ﷺ نے فسر ملیا کرا اے اچھٹ !Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.