Run this model with HF Jobs
Run TLDRKKU/HMk100 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/TLDRKKU/HMk100. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/TLDRKKU/HMk100 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/TLDRKKU/HMk100. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/TLDRKKU/HMk100. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use TLDRKKU/HMk100 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use TLDRKKU/HMk100 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct") model = PeftModel.from_pretrained(base_model, "TLDRKKU/HMk100") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files32 unmodified lines3334353637383940414243444546477 unmodified lines55565758596061622 unmodified lines65666732 unmodified lines## EvaluationFrom the project's internal eval harness (`runs/e2`, see `results.json` in this repo for full detail):| Test set | N | CER | Exact match ||---|---:|---:|---:|| hme (in-domain) | 24,607 | 0.0433 | 65.53% || burapha (out-of-domain) | 13,600 | 3.2159 | 0.10% || combined | 38,207 | 0.0797 | 42.24% |As expected for a single-dataset adapter, this model is strong on handwritten math and essentially unusable for Thai character recognition. See the sibling `burapha` repo for the BURAPHA-specialized adapter (experiment `e1`), or the project's `e3` run for an adapter trained on both datasets jointly.## How to Use7 unmodified linesrevision="cc594898137f460bfe9f0759e9844b3ce807cfb5",torch_dtype=torch.bfloat16,)model = PeftModel.from_pretrained(base, "ptnonsen/HMk100")processor = AutoProcessor.from_pretrained("ptnonsen/HMk100")```## Training Procedure2 unmodified lines- Effective batch size 32 (per-device 8 Γ grad accumulation 4)- bf16, gradient checkpointing enabled- Framework: PEFT 0.20.032 unmodified lines333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011027 unmodified lines1101111121131141151161172 unmodified lines12012112212312412512612732 unmodified lines## EvaluationFrom the project's internal eval harness (`runs/e2`, see `results.json` in this repo for full detail).| Test set | N | CER | char F1 | Exact match ||---|---:|---:|---:|---:|| hme (in-domain) | 24,607 | **0.0425** | 0.9766 | 65.53% || burapha (out-of-domain Thai) | 13,600 | 3.1985 | 0.0005 | 0.10% || thai_sentence (out-of-domain prose) | 2,032 | 1.3775 | 0.2088 | 0.05% || combined | 38,207 | 0.0800 | 0.9525 | 42.24% |## Findings**1. Catastrophic forgetting, and it is severe.** A CER of **3.1985** on BURAPHA is not"poor accuracy" β a CER above 1.0 means the model emits more erroneous characters than thereference contains. Character F1 of **0.0005** says the output shares essentially nocharacters with the target. Training on HME100K alone did not merely fail to teach Thai; itdestroyed the base model's ability to produce it. The same collapse appears on Thaisentences (CER 1.3775).This is the single most important result from the `e2` run, and it is why the project neverconsidered a math-only adapter for a Thai worksheet product.**2. `e3` dominates it outright.** The jointly-trained adapter matches `e2` on its own hometurf while keeping Thai intact:| | hme CER | burapha CER | thai_sentence CER ||---|---:|---:|---:|| `e2` (this model) | 0.0425 | **3.1985** | 1.3775 || **`e3` (joint)** | **0.0421** | **0.0400** | 0.6753 |`e3` is *better* on maths (0.0421 vs 0.0425) and ~80Γ better on Thai. There is no measuredtask on which `e2` is the right choice over `e3`. **`e2` is superseded.****3. Merging cannot repair it.** Weight-space merges of `e2` with the Thai adapter `e1`were tried at three ratios; every one gives up math accuracy without reaching `e3`'s Thai:| merge (e1βe2 weight) | hme CER | burapha CER ||---|---:|---:|| 0.3 β 0.7 | 0.0483 | 0.5144 || 0.5 β 0.5 | 0.0592 | 0.1215 || 0.7 β 0.3 | 0.1134 | 0.0480 || **`e3` (joint training)** | **0.0421** | **0.0400** |A three-way merge (`e7`) is worse still on maths (0.369β0.443). **Retrain jointly; do notmerge.****4. The decoder emits space-separated tokens, which inflates its CER against normallyspaced references.** `e2` and `e3` write maths as `\frac { \log _ { 2 } 6 }` β one spacebetween every token. Any character-level comparison against a normally spaced referencecharges each of those spaces as an edit. In this project that artifact was, for a time, readas evidence that the math adapters were worse than they are: on real worksheets awhitespace-keeping CER ranked a prose adapter first, while the same data with whitespaceremoved ranked the math-routed configuration first. **Report symbol-level (whitespace-stripped) CER alongside raw CER whenever comparing this adapter to a non-space-separateddecoder.****5. Benchmark strength does not transfer to real worksheets.** On real Thai studenthomework, symbol-level CER on mathematical regions was 0.451 (n=20) for the math-routedconfiguration, against 0.042 here. HME100K is a much easier distribution than photographedstudent work. Treat 0.0425 as an in-domain figure only.**6. Not selected for the production pipeline** β see `e3`, which is the deployedmathematics recogniser in the Learnly MVP's routed configuration. `e2` is retained as thesingle-dataset baseline that establishes the HME100K ceiling and documents the forgettingresult.## How to Use7 unmodified linesrevision="cc594898137f460bfe9f0759e9844b3ce807cfb5",torch_dtype=torch.bfloat16,)model = PeftModel.from_pretrained(base, "TLDRKKU/HMk100")processor = AutoProcessor.from_pretrained("TLDRKKU/HMk100")```## Training Procedure2 unmodified lines- Effective batch size 32 (per-device 8 Γ grad accumulation 4)- bf16, gradient checkpointing enabled- Framework: PEFT 0.20.0## Related- `TLDRKKU/burapha` β BURAPHA-only adapter (`e1`)- `TLDRKKU/burapha-HMk100` β joint adapter (`e3`), the one to prefer
README.md+69-9