Instructions to use giayphuyen/lora_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use giayphuyen/lora_model with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("./deepseek_ocr") model = PeftModel.from_pretrained(base_model, "giayphuyen/lora_model") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
LoRA Adapter for DeepSeek-OCR (Vietnamese Bills)
This repository contains LoRA fine-tuned weights for the model deepseek-ai/DeepSeek-OCR, specialized for OCR tasks.
Usage
from transformers import AutoModel, AutoTokenizer
from peft import PeftModel
import torch
base = "deepseek-ai/DeepSeek-OCR"
lora = "giayphuyen/lora_model"
tokenizer = AutoTokenizer.from_pretrained(base, trust_remote_code=True)
model = AutoModel.from_pretrained(base, trust_remote_code=True).cuda()
model = PeftModel.from_pretrained(model, lora)
model = model.eval().to(torch.bfloat16)
prompt = "<image>\nExtract the text."
image = "your_image.jpg"
res = model.infer(
tokenizer,
prompt=prompt,
image_file=image,
output_path=".",
)
print(res)
- Downloads last month
- 2
Model tree for giayphuyen/lora_model
Base model
deepseek-ai/DeepSeek-OCR