Instructions to use context212/alhazen-ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use context212/alhazen-ocr with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen3-vl-2b-instruct-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "context212/alhazen-ocr") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use context212/alhazen-ocr with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for context212/alhazen-ocr to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for context212/alhazen-ocr to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for context212/alhazen-ocr to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="context212/alhazen-ocr", max_seq_length=2048, )
Update model card: base vs Alhazen-OCR (khattmix eval)
Browse files
README.md
CHANGED
|
@@ -19,9 +19,9 @@ QLoRA adapter on [`unsloth/Qwen3-VL-2B-Instruct`](https://huggingface.co/unsloth
|
|
| 19 |
Named after Ibn al-Haytham (Alhazen), the 11th-century scholar who founded the science of optics.
|
| 20 |
|
| 21 |
- **Base:** Qwen3-VL-2B-Instruct (Apache-2.0)
|
| 22 |
-
- **Training data:** [`context212/context212-alhazen-ocr`](https://huggingface.co/datasets/context212/context212-alhazen-ocr)
|
| 23 |
- **Code:** [`github.com/context212/atlas-ocr`](https://github.com/context212/atlas-ocr)
|
| 24 |
-
- **Experiment sibling:** [`context212/alhazen-ocr-
|
| 25 |
|
| 26 |
## Results
|
| 27 |
|
|
@@ -30,17 +30,19 @@ CER / WER (lower is better), greedy decoding, **50 samples** each on the held-ou
|
|
| 30 |
| Model | Eval CER β | Eval WER β | KHATT CER β | KHATT WER β |
|
| 31 |
|---|---:|---:|---:|---:|
|
| 32 |
| Qwen3-VL-2B-Instruct (base) | 0.792 | 0.947 | 1.893 | 1.801 |
|
| 33 |
-
| **Alhazen-OCR** | **0.
|
| 34 |
|
| 35 |
-
Held-out character error
|
|
|
|
|
|
|
| 36 |
|
| 37 |
## Training
|
| 38 |
|
| 39 |
-
- **Objective:** QLoRA SFT, one epoch
|
| 40 |
- **LR:** 2e-5 cosine, warmup 5%
|
| 41 |
- **Effective batch:** 16 (8 Γ grad accum 2) on A100 80GB
|
| 42 |
- **LoRA:** r=16, RSLoRA, vision + language layers
|
| 43 |
-
- **Mix:**
|
| 44 |
|
| 45 |
## Usage
|
| 46 |
|
|
|
|
| 19 |
Named after Ibn al-Haytham (Alhazen), the 11th-century scholar who founded the science of optics.
|
| 20 |
|
| 21 |
- **Base:** Qwen3-VL-2B-Instruct (Apache-2.0)
|
| 22 |
+
- **Training data:** [`context212/context212-alhazen-ocr`](https://huggingface.co/datasets/context212/context212-alhazen-ocr) (khattmix rebuild)
|
| 23 |
- **Code:** [`github.com/context212/atlas-ocr`](https://github.com/context212/atlas-ocr)
|
| 24 |
+
- **Experiment sibling:** [`context212/alhazen-ocr-khattmix`](https://huggingface.co/context212/alhazen-ocr-khattmix)
|
| 25 |
|
| 26 |
## Results
|
| 27 |
|
|
|
|
| 30 |
| Model | Eval CER β | Eval WER β | KHATT CER β | KHATT WER β |
|
| 31 |
|---|---:|---:|---:|---:|
|
| 32 |
| Qwen3-VL-2B-Instruct (base) | 0.792 | 0.947 | 1.893 | 1.801 |
|
| 33 |
+
| **Alhazen-OCR** | **0.328** | **0.504** | **0.841** | **1.193** |
|
| 34 |
|
| 35 |
+
Held-out character error: **0.79 β 0.33**. External KHATT handwriting: **1.89 β 0.84** CER.
|
| 36 |
+
|
| 37 |
+
This release (khattmix) adds line-level KHATT handwriting (~30% of the mix) on top of synthetic printed, invoices, and paragraph handwriting; KHATT-bench transcript overlap is removed from train.
|
| 38 |
|
| 39 |
## Training
|
| 40 |
|
| 41 |
+
- **Objective:** QLoRA SFT, one epoch
|
| 42 |
- **LR:** 2e-5 cosine, warmup 5%
|
| 43 |
- **Effective batch:** 16 (8 Γ grad accum 2) on A100 80GB
|
| 44 |
- **LoRA:** r=16, RSLoRA, vision + language layers
|
| 45 |
+
- **Mix:** ~30% loay synthetic / 15% invoices / 30% KHATT lines / 23% KHATT paragraphs / 2% historical (~18k train rows)
|
| 46 |
|
| 47 |
## Usage
|
| 48 |
|