Views
No views yet
unsloth/DeepSeek-OCR-2 and exported as a full merged model for inference.unsloth/DeepSeek-OCR-2<image>\nOCR this image and output the Thai text.iapp/thai_handwriting_datasettrain[0:10150]train[10150:13600] (continuation phase)target_modules = ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]r = 16lora_alpha = 16lora_dropout = 0bias = "none"per_device_train_batch_size = 1gradient_accumulation_steps = 4learning_rate = 2e-4optim = "adamw_8bit"lr_scheduler_type = "linear"base_size = 1024image_size = 768crop_mode = Trueauto_resize = Truemax_dynamic_crops = 6model-00001-of-00002.safetensorsmodel-00002-of-00002.safetensorsmodel.safetensors.index.jsonconfig.json1from transformers import AutoModel
2from unsloth import FastVisionModel
3
4model, tokenizer = FastVisionModel.from_pretrained(
5 model_name="phoritus/deepseek-ocr2-thai",
6 auto_model=AutoModel,
7 trust_remote_code=True,
8 load_in_4bit=False,
9 device_map="auto",
10)
11
12result = model.infer(
13 tokenizer,
14 prompt="<image>\nOCR this image and output the Thai text.",
15 image_file="sample_image.jpg",
16 output_path="output_results",
17 base_size=1024,
18 image_size=768,
19 crop_mode=True,
20 save_results=True,
21 test_compress=False,
22)
23
24print(result)samples: 10wer: 1.0cer: 0.648695652173913mer: 1.0wil: 1.0wip: 0.0hits: 0substitutions: 12deletions: 2insertions: 0| order | source_idx | sample_wer | sample_cer |
|---|---|---|---|
| 1 | 440 | 1.0 | 0.8823529411764706 |
| 2 | 996 | 1.0 | 0.17543859649122806 |
| 3 | 687 | 1.0 | 0.7 |
| 4 | 124 | 1.0 | 0.7065217391304348 |
| 5 | 408 | 1.0 | 0.5074626865671642 |
| 6 | 46 | 1.0 | 0.36 |
| 7 | 404 | 1.0 | 0.7659574468085106 |
| 8 | 254 | 1.0 | 0.7941176470588235 |
| 9 | 666 | 1.0 | 0.8490566037735849 |
| 10 | 978 | 1.0 | 0.8823529411764706 |
unsloth/DeepSeek-OCR-2iapp/thai_handwriting_dataset