Views
No views yet
1{
2 "stem": "cleaned problem statement",
3 "answer_raw": "raw answer if clearly visible, otherwise empty",
4 "solution_raw": "",
5 "ocr_notes": ["risk tag 1", "risk tag 2"]
6}OCR -> OCR rebuilder -> existing GPT teaching chainstemanswer_rawsolution_rawsolution_raw is intentionally kept empty.Qwen/Qwen2.5-3B-Instructstage-1 protocol-only LoRAmax_new_tokens=192| Metric | Base model | Stage-1 adapter |
|---|---|---|
| JSON parse rate | 80.00% | 76.67% |
stem exact match | 0.00% | 16.67% |
answer_raw exact match | 16.67% | 60.00% |
| empty-answer hallucination | 23.33% | 0.00% |
1Base model 80.00% ████████████████
2Stage-1 adapter 76.67% ███████████████1Base model 16.67% ███
2Stage-1 adapter 60.00% ████████████1Base model 23.33% █████
2Stage-1 adapter 0.00%| Field | Base model | Stage-1 adapter |
|---|---|---|
stem avg similarity | 0.4898 | 0.7217 |
answer_raw avg similarity | 0.4058 | 0.6667 |
ocr_notes avg similarity | 0.1597 | 0.2391 |
1Base model 0.4898 ██████████
2Stage-1 adapter 0.7217 ██████████████1Base model 0.4058 ████████
2Stage-1 adapter 0.6667 █████████████answer_rawstemsingle_problem_rebuild: 204 synthetic/curated samplesmulti_problem_fragment_rebuild: 102 synthetic/curated samplessolution_raw generationsolution_raw is intentionally weak and currently fixed to empty.ocr_notes is helpful but not yet fully normalized.handler.py for Hugging Face Inference Endpoints custom deployment.1{
2 "inputs": "raw OCR text"
3}1{
2 "stem": "...",
3 "answer_raw": "...",
4 "solution_raw": "",
5 "ocr_notes": ["..."],
6 "meta": {
7 "raw_ocr_notes": ["model raw notes"]
8 }
9}1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3import torch
4
5base_model = "Qwen/Qwen2.5-3B-Instruct"
6adapter_model = "maru979/qwen2.5-3b-teacher-ocr-rebuilder"
7
8tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
9model = AutoModelForCausalLM.from_pretrained(
10 base_model,
11 torch_dtype=torch.float16,
12 device_map="auto",
13 trust_remote_code=True,
14)
15model = PeftModel.from_pretrained(model, adapter_model)
16model.eval()handler.py instead of directly exposing raw generation.