prosperious commited on
Commit
1ef1de7
·
verified ·
1 Parent(s): 23596ab

Add 195 files (runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/model.safetensors ...)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/model.safetensors +3 -0
  2. runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/preprocessor_config.json +28 -0
  3. runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/sentencepiece.bpe.model +3 -0
  4. runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/special_tokens_map.json +15 -0
  5. runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/tokenizer.json +0 -0
  6. runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/tokenizer_config.json +58 -0
  7. runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/training_args.bin +3 -0
  8. runs/hf-recognizer-mixed-v2-recipe/README.md +17 -0
  9. runs/hf-recognizer-mixed-v2-recipe/hf_recognizer_config.json +16 -0
  10. runs/hf-recognizer-next-v1-bundle/hf-recognizer-next-v1-training.tar.gz +3 -0
  11. runs/hf-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.json +104 -0
  12. runs/hf-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.md +25 -0
  13. runs/hf-recognizer-next-v1-bundle/recognizer-training-bundle.json +0 -0
  14. runs/hf-recognizer-next-v1-bundle/recognizer-training-bundle.md +14 -0
  15. runs/hf-recognizer-next-v1/README.md +18 -0
  16. runs/hf-recognizer-next-v1/hf_recognizer_config.json +16 -0
  17. runs/hf-recognizer-next-v1/recognizer-training-summary.json +99 -0
  18. runs/hf-recognizer-smoke/README.md +17 -0
  19. runs/hf-recognizer-smoke/checkpoints/checkpoint-5/config.json +122 -0
  20. runs/hf-recognizer-smoke/checkpoints/checkpoint-5/generation_config.json +38 -0
  21. runs/hf-recognizer-smoke/checkpoints/checkpoint-5/model.safetensors +3 -0
  22. runs/hf-recognizer-smoke/checkpoints/checkpoint-5/processor_config.json +30 -0
  23. runs/hf-recognizer-smoke/checkpoints/checkpoint-5/tokenizer.json +0 -0
  24. runs/hf-recognizer-smoke/checkpoints/checkpoint-5/tokenizer_config.json +22 -0
  25. runs/hf-recognizer-smoke/checkpoints/checkpoint-5/trainer_state.json +45 -0
  26. runs/hf-recognizer-smoke/checkpoints/checkpoint-5/training_args.bin +3 -0
  27. runs/hf-recognizer-smoke/final-model/config.json +122 -0
  28. runs/hf-recognizer-smoke/final-model/generation_config.json +38 -0
  29. runs/hf-recognizer-smoke/final-model/model.safetensors +3 -0
  30. runs/hf-recognizer-smoke/final-model/processor_config.json +30 -0
  31. runs/hf-recognizer-smoke/final-model/tokenizer.json +0 -0
  32. runs/hf-recognizer-smoke/final-model/tokenizer_config.json +22 -0
  33. runs/hf-recognizer-smoke/final-model/training_args.bin +3 -0
  34. runs/hf-recognizer-smoke/hf_recognizer_config.json +16 -0
  35. runs/hf-recognizer-smoke/package/PACKAGE.md +10 -0
  36. runs/hf-recognizer-smoke/package/artifacts/model/config.json +122 -0
  37. runs/hf-recognizer-smoke/package/artifacts/model/generation_config.json +38 -0
  38. runs/hf-recognizer-smoke/package/artifacts/model/model.safetensors +3 -0
  39. runs/hf-recognizer-smoke/package/artifacts/model/processor_config.json +30 -0
  40. runs/hf-recognizer-smoke/package/artifacts/model/tokenizer.json +0 -0
  41. runs/hf-recognizer-smoke/package/artifacts/model/tokenizer_config.json +22 -0
  42. runs/hf-recognizer-smoke/package/artifacts/model/training_args.bin +3 -0
  43. runs/hf-recognizer-smoke/package/model-card.json +36 -0
  44. runs/hf-recognizer-smoke/training_metrics.json +10 -0
  45. runs/hf-table-figure-dev-v1/README.md +17 -0
  46. runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/config.json +59 -0
  47. runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/generation_config.json +11 -0
  48. runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/model.safetensors +3 -0
  49. runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/preprocessor_config.json +28 -0
  50. runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/sentencepiece.bpe.model +3 -0
runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7d84cca6f92383175762250067be1f19bc29bf08cd95419318325bd031c303a
3
+ size 246430696
runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/preprocessor_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 224,
4
+ "width": 224
5
+ },
6
+ "do_center_crop": false,
7
+ "do_normalize": true,
8
+ "do_rescale": true,
9
+ "do_resize": true,
10
+ "image_mean": [
11
+ 0.5,
12
+ 0.5,
13
+ 0.5
14
+ ],
15
+ "image_processor_type": "DeiTImageProcessor",
16
+ "image_std": [
17
+ 0.5,
18
+ 0.5,
19
+ 0.5
20
+ ],
21
+ "processor_class": "TrOCRProcessor",
22
+ "resample": 3,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "height": 384,
26
+ "width": 384
27
+ }
28
+ }
runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4
3
+ size 1356293
runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "mask_token": {
6
+ "content": "<mask>",
7
+ "lstrip": true,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "pad_token": "<pad>",
13
+ "sep_token": "</s>",
14
+ "unk_token": "<unk>"
15
+ }
runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "64001": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
38
+ "normalized": true,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "backend": "pil",
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": false,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "extra_special_tokens": {},
50
+ "mask_token": "<mask>",
51
+ "model_max_length": 1000000000000000019884624838656,
52
+ "pad_token": "<pad>",
53
+ "processor_class": "TrOCRProcessor",
54
+ "sep_token": "</s>",
55
+ "sp_model_kwargs": {},
56
+ "tokenizer_class": "XLMRobertaTokenizer",
57
+ "unk_token": "<unk>"
58
+ }
runs/hf-recognizer-mixed-v2-full/finalized/package/artifacts/model/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:622c1f1907a1a103831007f30fc86f3cb241cc4d62131d3d5b46bbafbbbaba69
3
+ size 6033
runs/hf-recognizer-mixed-v2-recipe/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Recognizer Training Recipe
2
+
3
+ Base model: `microsoft/trocr-small-printed`
4
+ Train manifest: `data/splits-mixed-v1/train-rebalanced-nep-eng.jsonl` (1700 samples)
5
+ Eval manifest: `data/splits-mixed-v1/eval-with-refs.jsonl` (180 samples)
6
+
7
+ Install the backend dependencies first:
8
+
9
+ ```bash
10
+ python -m pip install -e '.[hf-recognizer]'
11
+ ```
12
+
13
+ Run in-process:
14
+
15
+ ```bash
16
+ ocrtech train-recognizer --backend hf-vision-encoder-decoder --train-manifest data/splits-mixed-v1/train-rebalanced-nep-eng.jsonl --eval-manifest data/splits-mixed-v1/eval-with-refs.jsonl --out runs/hf-recognizer-mixed-v2-recipe --run
17
+ ```
runs/hf-recognizer-mixed-v2-recipe/hf_recognizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "train_manifest": "data/splits-mixed-v1/train-rebalanced-nep-eng.jsonl",
3
+ "eval_manifest": "data/splits-mixed-v1/eval-with-refs.jsonl",
4
+ "output_dir": "runs/hf-recognizer-mixed-v2-recipe",
5
+ "base_model": "microsoft/trocr-small-printed",
6
+ "max_target_length": 128,
7
+ "per_device_train_batch_size": 4,
8
+ "per_device_eval_batch_size": 4,
9
+ "learning_rate": 5e-05,
10
+ "num_train_epochs": 3.0,
11
+ "warmup_steps": 0,
12
+ "logging_steps": 10,
13
+ "save_total_limit": 2,
14
+ "predict_with_generate": true,
15
+ "generation_max_length": 128
16
+ }
runs/hf-recognizer-next-v1-bundle/hf-recognizer-next-v1-training.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aff0b277b9cfdd353ed82178c65586353c3511d6db06bd20099cbc62df113873
3
+ size 75668046
runs/hf-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.json ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "train_manifest": "/Users/k2/ocr-tech/data/splits-recognizer-next-v1/train.jsonl",
3
+ "eval_manifest": "/Users/k2/ocr-tech/data/splits-recognizer-next-v1/eval.jsonl",
4
+ "passed": true,
5
+ "train_profile": {
6
+ "manifest_path": "/Users/k2/ocr-tech/data/splits-recognizer-next-v1/train.jsonl",
7
+ "sample_count": 2212,
8
+ "dataset_counts": {
9
+ "gauravgiri__nepali-ocr-dataset": 428,
10
+ "nvidia__OCR-Synthetic-Multilingual-v1__en": 850,
11
+ "ocrtech-crops": 512,
12
+ "prashant0919__nepali-synthetic-ocr-lines": 422
13
+ },
14
+ "slice_counts": {
15
+ "blur": 126,
16
+ "clean": 129,
17
+ "crop": 512,
18
+ "en": 850,
19
+ "english": 1362,
20
+ "figure": 132,
21
+ "figure_caption": 35,
22
+ "image": 512,
23
+ "line": 129,
24
+ "line_crop": 850,
25
+ "low_contrast": 130,
26
+ "mixed_script": 512,
27
+ "nepali": 1362,
28
+ "reading_order": 512,
29
+ "real": 428,
30
+ "scan": 127,
31
+ "synthetic": 1272,
32
+ "table": 380,
33
+ "table_cell": 348
34
+ },
35
+ "script_counts": {
36
+ "devanagari": 25516,
37
+ "digit": 2071,
38
+ "latin": 23471,
39
+ "other": 30,
40
+ "punctuation": 1617
41
+ },
42
+ "script_sample_counts": {
43
+ "contains_devanagari": 1174,
44
+ "contains_latin": 1084,
45
+ "devanagari_only": 1074,
46
+ "latin_only": 984,
47
+ "mixed_devanagari_latin": 100,
48
+ "other_only": 54
49
+ }
50
+ },
51
+ "eval_profile": {
52
+ "manifest_path": "/Users/k2/ocr-tech/data/splits-recognizer-next-v1/eval.jsonl",
53
+ "sample_count": 244,
54
+ "dataset_counts": {
55
+ "gauravgiri__nepali-ocr-dataset": 15,
56
+ "nvidia__OCR-Synthetic-Multilingual-v1__en": 150,
57
+ "ocrtech-crops": 64,
58
+ "prashant0919__nepali-synthetic-ocr-lines": 15
59
+ },
60
+ "slice_counts": {
61
+ "blur": 16,
62
+ "clean": 16,
63
+ "crop": 64,
64
+ "en": 150,
65
+ "english": 214,
66
+ "figure": 28,
67
+ "figure_caption": 8,
68
+ "image": 64,
69
+ "line": 20,
70
+ "line_crop": 150,
71
+ "low_contrast": 16,
72
+ "mixed_script": 64,
73
+ "nepali": 94,
74
+ "reading_order": 64,
75
+ "real": 15,
76
+ "scan": 16,
77
+ "synthetic": 165,
78
+ "table": 36,
79
+ "table_cell": 36
80
+ },
81
+ "script_counts": {
82
+ "devanagari": 1623,
83
+ "digit": 356,
84
+ "latin": 4313,
85
+ "other": 2,
86
+ "punctuation": 251
87
+ },
88
+ "script_sample_counts": {
89
+ "contains_devanagari": 90,
90
+ "contains_latin": 172,
91
+ "devanagari_only": 62,
92
+ "latin_only": 144,
93
+ "mixed_devanagari_latin": 28,
94
+ "other_only": 10
95
+ }
96
+ },
97
+ "leakage_passed": true,
98
+ "issues": [],
99
+ "warnings": [
100
+ "eval manifest has no hard_eval slice; recognizer admission should still use a separate hard gate"
101
+ ],
102
+ "summary_json_path": "runs/hf-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.json",
103
+ "summary_md_path": "runs/hf-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.md"
104
+ }
runs/hf-recognizer-next-v1-bundle/recognizer-corpus-audit/recognizer-corpus-audit.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Recognizer Corpus Audit
2
+
3
+ Passed: `yes`
4
+ Train manifest: `/Users/k2/ocr-tech/data/splits-recognizer-next-v1/train.jsonl`
5
+ Eval manifest: `/Users/k2/ocr-tech/data/splits-recognizer-next-v1/eval.jsonl`
6
+ Leakage check: `pass`
7
+
8
+ ## Profiles
9
+
10
+ | split | samples | latin | devanagari | mixed | real | synthetic |
11
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: |
12
+ | train | 2212 | 1084 | 1174 | 100 | 428 | 1272 |
13
+ | eval | 244 | 172 | 90 | 28 | 15 | 165 |
14
+
15
+ ## Issues
16
+
17
+ - none
18
+
19
+ ## Warnings
20
+
21
+ - eval manifest has no hard_eval slice; recognizer admission should still use a separate hard gate
22
+
23
+ ## Next Actions
24
+
25
+ - corpus passes the configured recognizer training gate
runs/hf-recognizer-next-v1-bundle/recognizer-training-bundle.json ADDED
The diff for this file is too large to render. See raw diff
 
runs/hf-recognizer-next-v1-bundle/recognizer-training-bundle.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Recognizer Training Bundle
2
+
3
+ Archive: `runs/hf-recognizer-next-v1-bundle/hf-recognizer-next-v1-training.tar.gz`
4
+ Training summary: `runs/hf-recognizer-next-v1/recognizer-training-summary.json`
5
+ Recognizer corpus audit: `recognizer-corpus-audit/recognizer-corpus-audit.json`
6
+ Files: `2463`
7
+ Bytes before compression: `82091601`
8
+
9
+ Extract this archive at the root of an ocr-tech workspace or an empty training workspace. The recipe uses relative paths, so run training from the extraction root.
10
+
11
+ ```bash
12
+ tar -xzf hf-recognizer-next-v1-training.tar.gz
13
+ ocrtech train-recognizer --backend hf-vision-encoder-decoder --base-model microsoft/trocr-small-printed --train-manifest data/splits-recognizer-next-v1/train.jsonl --eval-manifest data/splits-recognizer-next-v1/eval.jsonl --out runs/hf-recognizer-next-v1 --max-target-length 128 --train-batch-size 8 --eval-batch-size 8 --learning-rate 5e-05 --epochs 5 --run
14
+ ```
runs/hf-recognizer-next-v1/README.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Recognizer Training Recipe
2
+
3
+ Training summary: `runs/hf-recognizer-next-v1/recognizer-training-summary.json`
4
+ Base model: `microsoft/trocr-small-printed`
5
+ Train manifest: `data/splits-recognizer-next-v1/train.jsonl` (2212 samples)
6
+ Eval manifest: `data/splits-recognizer-next-v1/eval.jsonl` (244 samples)
7
+
8
+ Install the backend dependencies first:
9
+
10
+ ```bash
11
+ python -m pip install -e '.[hf-recognizer]'
12
+ ```
13
+
14
+ Run in-process:
15
+
16
+ ```bash
17
+ ocrtech train-recognizer --backend hf-vision-encoder-decoder --base-model microsoft/trocr-small-printed --train-manifest data/splits-recognizer-next-v1/train.jsonl --eval-manifest data/splits-recognizer-next-v1/eval.jsonl --out runs/hf-recognizer-next-v1 --max-target-length 128 --train-batch-size 8 --eval-batch-size 8 --learning-rate 5e-05 --epochs 5 --run
18
+ ```
runs/hf-recognizer-next-v1/hf_recognizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "train_manifest": "data/splits-recognizer-next-v1/train.jsonl",
3
+ "eval_manifest": "data/splits-recognizer-next-v1/eval.jsonl",
4
+ "output_dir": "runs/hf-recognizer-next-v1",
5
+ "base_model": "microsoft/trocr-small-printed",
6
+ "max_target_length": 128,
7
+ "per_device_train_batch_size": 8,
8
+ "per_device_eval_batch_size": 8,
9
+ "learning_rate": 5e-05,
10
+ "num_train_epochs": 5.0,
11
+ "warmup_steps": 0,
12
+ "logging_steps": 10,
13
+ "save_total_limit": 2,
14
+ "predict_with_generate": true,
15
+ "generation_max_length": 128
16
+ }
runs/hf-recognizer-next-v1/recognizer-training-summary.json ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "hf_vision_encoder_decoder",
3
+ "base_model": "microsoft/trocr-small-printed",
4
+ "manifests": {
5
+ "train": {
6
+ "path": "data/splits-recognizer-next-v1/train.jsonl",
7
+ "sha256": "2331f82c23d4064a47ea15141dcc086175d86d306bba1699983fc8356b9dfbe8",
8
+ "sample_count": 2212,
9
+ "dataset_counts": {
10
+ "gauravgiri__nepali-ocr-dataset": 428,
11
+ "nvidia__OCR-Synthetic-Multilingual-v1__en": 850,
12
+ "ocrtech-crops": 512,
13
+ "prashant0919__nepali-synthetic-ocr-lines": 422
14
+ },
15
+ "slice_counts": {
16
+ "blur": 126,
17
+ "clean": 129,
18
+ "crop": 512,
19
+ "en": 850,
20
+ "english": 1362,
21
+ "figure": 132,
22
+ "figure_caption": 35,
23
+ "image": 512,
24
+ "line": 129,
25
+ "line_crop": 850,
26
+ "low_contrast": 130,
27
+ "mixed_script": 512,
28
+ "nepali": 1362,
29
+ "reading_order": 512,
30
+ "real": 428,
31
+ "scan": 127,
32
+ "synthetic": 1272,
33
+ "table": 380,
34
+ "table_cell": 348
35
+ },
36
+ "character_count": 176,
37
+ "contains_ascii": true,
38
+ "contains_devanagari": true
39
+ },
40
+ "eval": {
41
+ "path": "data/splits-recognizer-next-v1/eval.jsonl",
42
+ "sha256": "0cc6f42c806cf8d8df59d6e046792967b1557eb523dba1493a927e815e35d5c7",
43
+ "sample_count": 244,
44
+ "dataset_counts": {
45
+ "gauravgiri__nepali-ocr-dataset": 15,
46
+ "nvidia__OCR-Synthetic-Multilingual-v1__en": 150,
47
+ "ocrtech-crops": 64,
48
+ "prashant0919__nepali-synthetic-ocr-lines": 15
49
+ },
50
+ "slice_counts": {
51
+ "blur": 16,
52
+ "clean": 16,
53
+ "crop": 64,
54
+ "en": 150,
55
+ "english": 214,
56
+ "figure": 28,
57
+ "figure_caption": 8,
58
+ "image": 64,
59
+ "line": 20,
60
+ "line_crop": 150,
61
+ "low_contrast": 16,
62
+ "mixed_script": 64,
63
+ "nepali": 94,
64
+ "reading_order": 64,
65
+ "real": 15,
66
+ "scan": 16,
67
+ "synthetic": 165,
68
+ "table": 36,
69
+ "table_cell": 36
70
+ },
71
+ "character_count": 170,
72
+ "contains_ascii": true,
73
+ "contains_devanagari": true
74
+ }
75
+ },
76
+ "artifacts": {
77
+ "config": {
78
+ "path": "runs/hf-recognizer-next-v1/hf_recognizer_config.json",
79
+ "sha256": "70dc9765106685cf51adc787e9fb7b2cc4aced7a1dfee32686e9ed6eb58296a7"
80
+ },
81
+ "dictionary": {
82
+ "character_count": 177,
83
+ "contains_space": true,
84
+ "contains_ascii": true,
85
+ "contains_devanagari": true
86
+ }
87
+ },
88
+ "hyperparameters": {
89
+ "max_target_length": 128,
90
+ "per_device_train_batch_size": 8,
91
+ "per_device_eval_batch_size": 8,
92
+ "learning_rate": 5e-05,
93
+ "num_train_epochs": 5.0,
94
+ "warmup_steps": 0,
95
+ "logging_steps": 10,
96
+ "save_total_limit": 2,
97
+ "generation_max_length": 128
98
+ }
99
+ }
runs/hf-recognizer-smoke/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Recognizer Training Recipe
2
+
3
+ Base model: `microsoft/trocr-small-printed`
4
+ Train manifest: `data/splits/train.jsonl` (167 samples)
5
+ Eval manifest: `data/splits/eval.jsonl` (30 samples)
6
+
7
+ Install the backend dependencies first:
8
+
9
+ ```bash
10
+ python -m pip install -e '.[hf-recognizer]'
11
+ ```
12
+
13
+ Run in-process:
14
+
15
+ ```bash
16
+ ocrtech train-recognizer --backend hf-vision-encoder-decoder --train-manifest data/splits/train.jsonl --eval-manifest data/splits/eval.jsonl --out runs/hf-recognizer-smoke --run
17
+ ```
runs/hf-recognizer-smoke/checkpoints/checkpoint-5/config.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VisionEncoderDecoderModel"
4
+ ],
5
+ "bos_token_id": 0,
6
+ "decoder": {
7
+ "_name_or_path": "",
8
+ "activation_dropout": 0.0,
9
+ "activation_function": "relu",
10
+ "add_cross_attention": true,
11
+ "architectures": null,
12
+ "attention_dropout": 0.0,
13
+ "bos_token_id": 0,
14
+ "chunk_size_feed_forward": 0,
15
+ "classifier_dropout": 0.0,
16
+ "cross_attention_hidden_size": 384,
17
+ "d_model": 256,
18
+ "decoder_attention_heads": 8,
19
+ "decoder_ffn_dim": 1024,
20
+ "decoder_layerdrop": 0.0,
21
+ "decoder_layers": 6,
22
+ "decoder_start_token_id": 2,
23
+ "dropout": 0.1,
24
+ "dtype": "float32",
25
+ "eos_token_id": 2,
26
+ "finetuning_task": null,
27
+ "id2label": {
28
+ "0": "LABEL_0",
29
+ "1": "LABEL_1"
30
+ },
31
+ "init_std": 0.02,
32
+ "is_decoder": true,
33
+ "is_encoder_decoder": false,
34
+ "label2id": {
35
+ "LABEL_0": 0,
36
+ "LABEL_1": 1
37
+ },
38
+ "layernorm_embedding": true,
39
+ "max_position_embeddings": 512,
40
+ "model_type": "trocr",
41
+ "output_attentions": false,
42
+ "output_hidden_states": false,
43
+ "pad_token_id": 1,
44
+ "prefix": null,
45
+ "problem_type": null,
46
+ "pruned_heads": {},
47
+ "return_dict": true,
48
+ "scale_embedding": true,
49
+ "sep_token_id": null,
50
+ "task_specific_params": null,
51
+ "tie_encoder_decoder": false,
52
+ "tie_word_embeddings": false,
53
+ "tokenizer_class": null,
54
+ "torchscript": false,
55
+ "use_bfloat16": false,
56
+ "use_cache": false,
57
+ "use_learned_position_embeddings": true,
58
+ "vocab_size": 64044
59
+ },
60
+ "decoder_start_token_id": 2,
61
+ "dtype": "float32",
62
+ "encoder": {
63
+ "_name_or_path": "",
64
+ "add_cross_attention": false,
65
+ "architectures": null,
66
+ "attention_probs_dropout_prob": 0.0,
67
+ "bos_token_id": null,
68
+ "chunk_size_feed_forward": 0,
69
+ "cross_attention_hidden_size": null,
70
+ "decoder_start_token_id": null,
71
+ "dtype": "float32",
72
+ "encoder_stride": 16,
73
+ "eos_token_id": null,
74
+ "finetuning_task": null,
75
+ "hidden_act": "gelu",
76
+ "hidden_dropout_prob": 0.0,
77
+ "hidden_size": 384,
78
+ "id2label": {
79
+ "0": "LABEL_0",
80
+ "1": "LABEL_1"
81
+ },
82
+ "image_size": 384,
83
+ "initializer_range": 0.02,
84
+ "intermediate_size": 1536,
85
+ "is_decoder": false,
86
+ "is_encoder_decoder": false,
87
+ "label2id": {
88
+ "LABEL_0": 0,
89
+ "LABEL_1": 1
90
+ },
91
+ "layer_norm_eps": 1e-12,
92
+ "model_type": "deit",
93
+ "num_attention_heads": 6,
94
+ "num_channels": 3,
95
+ "num_hidden_layers": 12,
96
+ "output_attentions": false,
97
+ "output_hidden_states": false,
98
+ "pad_token_id": null,
99
+ "patch_size": 16,
100
+ "pooler_act": "tanh",
101
+ "pooler_output_size": 384,
102
+ "prefix": null,
103
+ "problem_type": null,
104
+ "pruned_heads": {},
105
+ "qkv_bias": true,
106
+ "return_dict": true,
107
+ "sep_token_id": null,
108
+ "task_specific_params": null,
109
+ "tie_encoder_decoder": false,
110
+ "tie_word_embeddings": true,
111
+ "tokenizer_class": null,
112
+ "torchscript": false,
113
+ "use_bfloat16": false
114
+ },
115
+ "eos_token_id": 2,
116
+ "is_encoder_decoder": true,
117
+ "model_type": "vision-encoder-decoder",
118
+ "pad_token_id": 1,
119
+ "tie_word_embeddings": false,
120
+ "transformers_version": "5.12.0",
121
+ "use_cache": false
122
+ }
runs/hf-recognizer-smoke/checkpoints/checkpoint-5/generation_config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": false,
3
+ "assistant_confidence_threshold": 0.4,
4
+ "assistant_lookbehind": 10,
5
+ "bos_token_id": 0,
6
+ "decoder_start_token_id": 2,
7
+ "diversity_penalty": 0.0,
8
+ "do_sample": false,
9
+ "early_stopping": false,
10
+ "encoder_no_repeat_ngram_size": 0,
11
+ "encoder_repetition_penalty": 1.0,
12
+ "eos_token_id": [
13
+ 2
14
+ ],
15
+ "epsilon_cutoff": 0.0,
16
+ "eta_cutoff": 0.0,
17
+ "length_penalty": 1.0,
18
+ "max_length": 128,
19
+ "min_length": 0,
20
+ "no_repeat_ngram_size": 0,
21
+ "num_assistant_tokens": 20,
22
+ "num_assistant_tokens_schedule": "constant",
23
+ "num_beam_groups": 1,
24
+ "num_beams": 1,
25
+ "num_return_sequences": 1,
26
+ "output_scores": false,
27
+ "pad_token_id": 1,
28
+ "remove_invalid_values": false,
29
+ "repetition_penalty": 1.0,
30
+ "return_dict_in_generate": false,
31
+ "target_lookbehind": 10,
32
+ "temperature": 1.0,
33
+ "top_k": 50,
34
+ "top_p": 1.0,
35
+ "transformers_version": "5.12.0",
36
+ "typical_p": 1.0,
37
+ "use_cache": false
38
+ }
runs/hf-recognizer-smoke/checkpoints/checkpoint-5/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c3ad073e00860edc0a2bf5f19f8a5dd88c01dd114f2aa94bb464de73cb68dad
3
+ size 246430696
runs/hf-recognizer-smoke/checkpoints/checkpoint-5/processor_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "crop_size": {
4
+ "height": 224,
5
+ "width": 224
6
+ },
7
+ "do_center_crop": false,
8
+ "do_normalize": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "image_mean": [
12
+ 0.5,
13
+ 0.5,
14
+ 0.5
15
+ ],
16
+ "image_processor_type": "DeiTImageProcessor",
17
+ "image_std": [
18
+ 0.5,
19
+ 0.5,
20
+ 0.5
21
+ ],
22
+ "resample": 3,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "height": 384,
26
+ "width": 384
27
+ }
28
+ },
29
+ "processor_class": "TrOCRProcessor"
30
+ }
runs/hf-recognizer-smoke/checkpoints/checkpoint-5/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
runs/hf-recognizer-smoke/checkpoints/checkpoint-5/tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "backend": "pil",
4
+ "bos_token": "<s>",
5
+ "cls_token": "<s>",
6
+ "eos_token": "</s>",
7
+ "extra_special_tokens": [
8
+ "<s>",
9
+ "</s>"
10
+ ],
11
+ "is_local": false,
12
+ "local_files_only": false,
13
+ "mask_token": "<mask>",
14
+ "model_max_length": 1000000000000000019884624838656,
15
+ "pad_token": "<pad>",
16
+ "processor_class": "TrOCRProcessor",
17
+ "sep_token": "</s>",
18
+ "sp_model_kwargs": {},
19
+ "tokenizer_class": "XLMRobertaTokenizer",
20
+ "unk_id": 0,
21
+ "unk_token": "<unk>"
22
+ }
runs/hf-recognizer-smoke/checkpoints/checkpoint-5/trainer_state.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.05952380952380952,
6
+ "eval_steps": 500,
7
+ "global_step": 5,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "epoch": 0.05952380952380952,
14
+ "eval_cer": 19.09515372131417,
15
+ "eval_exact_line_accuracy": 0.0,
16
+ "eval_loss": 9.87027359008789,
17
+ "eval_runtime": 66.6463,
18
+ "eval_samples_per_second": 0.45,
19
+ "eval_steps_per_second": 0.225,
20
+ "eval_wer": 2.115873015873016,
21
+ "step": 5
22
+ }
23
+ ],
24
+ "logging_steps": 10,
25
+ "max_steps": 5,
26
+ "num_input_tokens_seen": 0,
27
+ "num_train_epochs": 1,
28
+ "save_steps": 500,
29
+ "stateful_callbacks": {
30
+ "TrainerControl": {
31
+ "args": {
32
+ "should_epoch_stop": false,
33
+ "should_evaluate": false,
34
+ "should_log": false,
35
+ "should_save": true,
36
+ "should_training_stop": true
37
+ },
38
+ "attributes": {}
39
+ }
40
+ },
41
+ "total_flos": 1196246874193920.0,
42
+ "train_batch_size": 2,
43
+ "trial_name": null,
44
+ "trial_params": null
45
+ }
runs/hf-recognizer-smoke/checkpoints/checkpoint-5/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a410ce8085ecd780194163c2efcb931027bd4e680e143dacf2e216a2fc59aa47
3
+ size 5329
runs/hf-recognizer-smoke/final-model/config.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VisionEncoderDecoderModel"
4
+ ],
5
+ "bos_token_id": 0,
6
+ "decoder": {
7
+ "_name_or_path": "",
8
+ "activation_dropout": 0.0,
9
+ "activation_function": "relu",
10
+ "add_cross_attention": true,
11
+ "architectures": null,
12
+ "attention_dropout": 0.0,
13
+ "bos_token_id": 0,
14
+ "chunk_size_feed_forward": 0,
15
+ "classifier_dropout": 0.0,
16
+ "cross_attention_hidden_size": 384,
17
+ "d_model": 256,
18
+ "decoder_attention_heads": 8,
19
+ "decoder_ffn_dim": 1024,
20
+ "decoder_layerdrop": 0.0,
21
+ "decoder_layers": 6,
22
+ "decoder_start_token_id": 2,
23
+ "dropout": 0.1,
24
+ "dtype": "float32",
25
+ "eos_token_id": 2,
26
+ "finetuning_task": null,
27
+ "id2label": {
28
+ "0": "LABEL_0",
29
+ "1": "LABEL_1"
30
+ },
31
+ "init_std": 0.02,
32
+ "is_decoder": true,
33
+ "is_encoder_decoder": false,
34
+ "label2id": {
35
+ "LABEL_0": 0,
36
+ "LABEL_1": 1
37
+ },
38
+ "layernorm_embedding": true,
39
+ "max_position_embeddings": 512,
40
+ "model_type": "trocr",
41
+ "output_attentions": false,
42
+ "output_hidden_states": false,
43
+ "pad_token_id": 1,
44
+ "prefix": null,
45
+ "problem_type": null,
46
+ "pruned_heads": {},
47
+ "return_dict": true,
48
+ "scale_embedding": true,
49
+ "sep_token_id": null,
50
+ "task_specific_params": null,
51
+ "tie_encoder_decoder": false,
52
+ "tie_word_embeddings": false,
53
+ "tokenizer_class": null,
54
+ "torchscript": false,
55
+ "use_bfloat16": false,
56
+ "use_cache": false,
57
+ "use_learned_position_embeddings": true,
58
+ "vocab_size": 64044
59
+ },
60
+ "decoder_start_token_id": 2,
61
+ "dtype": "float32",
62
+ "encoder": {
63
+ "_name_or_path": "",
64
+ "add_cross_attention": false,
65
+ "architectures": null,
66
+ "attention_probs_dropout_prob": 0.0,
67
+ "bos_token_id": null,
68
+ "chunk_size_feed_forward": 0,
69
+ "cross_attention_hidden_size": null,
70
+ "decoder_start_token_id": null,
71
+ "dtype": "float32",
72
+ "encoder_stride": 16,
73
+ "eos_token_id": null,
74
+ "finetuning_task": null,
75
+ "hidden_act": "gelu",
76
+ "hidden_dropout_prob": 0.0,
77
+ "hidden_size": 384,
78
+ "id2label": {
79
+ "0": "LABEL_0",
80
+ "1": "LABEL_1"
81
+ },
82
+ "image_size": 384,
83
+ "initializer_range": 0.02,
84
+ "intermediate_size": 1536,
85
+ "is_decoder": false,
86
+ "is_encoder_decoder": false,
87
+ "label2id": {
88
+ "LABEL_0": 0,
89
+ "LABEL_1": 1
90
+ },
91
+ "layer_norm_eps": 1e-12,
92
+ "model_type": "deit",
93
+ "num_attention_heads": 6,
94
+ "num_channels": 3,
95
+ "num_hidden_layers": 12,
96
+ "output_attentions": false,
97
+ "output_hidden_states": false,
98
+ "pad_token_id": null,
99
+ "patch_size": 16,
100
+ "pooler_act": "tanh",
101
+ "pooler_output_size": 384,
102
+ "prefix": null,
103
+ "problem_type": null,
104
+ "pruned_heads": {},
105
+ "qkv_bias": true,
106
+ "return_dict": true,
107
+ "sep_token_id": null,
108
+ "task_specific_params": null,
109
+ "tie_encoder_decoder": false,
110
+ "tie_word_embeddings": true,
111
+ "tokenizer_class": null,
112
+ "torchscript": false,
113
+ "use_bfloat16": false
114
+ },
115
+ "eos_token_id": 2,
116
+ "is_encoder_decoder": true,
117
+ "model_type": "vision-encoder-decoder",
118
+ "pad_token_id": 1,
119
+ "tie_word_embeddings": false,
120
+ "transformers_version": "5.12.0",
121
+ "use_cache": false
122
+ }
runs/hf-recognizer-smoke/final-model/generation_config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": false,
3
+ "assistant_confidence_threshold": 0.4,
4
+ "assistant_lookbehind": 10,
5
+ "bos_token_id": 0,
6
+ "decoder_start_token_id": 2,
7
+ "diversity_penalty": 0.0,
8
+ "do_sample": false,
9
+ "early_stopping": false,
10
+ "encoder_no_repeat_ngram_size": 0,
11
+ "encoder_repetition_penalty": 1.0,
12
+ "eos_token_id": [
13
+ 2
14
+ ],
15
+ "epsilon_cutoff": 0.0,
16
+ "eta_cutoff": 0.0,
17
+ "length_penalty": 1.0,
18
+ "max_length": 128,
19
+ "min_length": 0,
20
+ "no_repeat_ngram_size": 0,
21
+ "num_assistant_tokens": 20,
22
+ "num_assistant_tokens_schedule": "constant",
23
+ "num_beam_groups": 1,
24
+ "num_beams": 1,
25
+ "num_return_sequences": 1,
26
+ "output_scores": false,
27
+ "pad_token_id": 1,
28
+ "remove_invalid_values": false,
29
+ "repetition_penalty": 1.0,
30
+ "return_dict_in_generate": false,
31
+ "target_lookbehind": 10,
32
+ "temperature": 1.0,
33
+ "top_k": 50,
34
+ "top_p": 1.0,
35
+ "transformers_version": "5.12.0",
36
+ "typical_p": 1.0,
37
+ "use_cache": false
38
+ }
runs/hf-recognizer-smoke/final-model/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c3ad073e00860edc0a2bf5f19f8a5dd88c01dd114f2aa94bb464de73cb68dad
3
+ size 246430696
runs/hf-recognizer-smoke/final-model/processor_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "crop_size": {
4
+ "height": 224,
5
+ "width": 224
6
+ },
7
+ "do_center_crop": false,
8
+ "do_normalize": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "image_mean": [
12
+ 0.5,
13
+ 0.5,
14
+ 0.5
15
+ ],
16
+ "image_processor_type": "DeiTImageProcessor",
17
+ "image_std": [
18
+ 0.5,
19
+ 0.5,
20
+ 0.5
21
+ ],
22
+ "resample": 3,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "height": 384,
26
+ "width": 384
27
+ }
28
+ },
29
+ "processor_class": "TrOCRProcessor"
30
+ }
runs/hf-recognizer-smoke/final-model/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
runs/hf-recognizer-smoke/final-model/tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "backend": "pil",
4
+ "bos_token": "<s>",
5
+ "cls_token": "<s>",
6
+ "eos_token": "</s>",
7
+ "extra_special_tokens": [
8
+ "<s>",
9
+ "</s>"
10
+ ],
11
+ "is_local": false,
12
+ "local_files_only": false,
13
+ "mask_token": "<mask>",
14
+ "model_max_length": 1000000000000000019884624838656,
15
+ "pad_token": "<pad>",
16
+ "processor_class": "TrOCRProcessor",
17
+ "sep_token": "</s>",
18
+ "sp_model_kwargs": {},
19
+ "tokenizer_class": "XLMRobertaTokenizer",
20
+ "unk_id": 0,
21
+ "unk_token": "<unk>"
22
+ }
runs/hf-recognizer-smoke/final-model/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a410ce8085ecd780194163c2efcb931027bd4e680e143dacf2e216a2fc59aa47
3
+ size 5329
runs/hf-recognizer-smoke/hf_recognizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "train_manifest": "data/splits/train.jsonl",
3
+ "eval_manifest": "data/splits/eval.jsonl",
4
+ "output_dir": "runs/hf-recognizer-smoke",
5
+ "base_model": "microsoft/trocr-small-printed",
6
+ "max_target_length": 128,
7
+ "per_device_train_batch_size": 2,
8
+ "per_device_eval_batch_size": 2,
9
+ "learning_rate": 5e-05,
10
+ "num_train_epochs": 0.05,
11
+ "warmup_steps": 0,
12
+ "logging_steps": 10,
13
+ "save_total_limit": 2,
14
+ "predict_with_generate": true,
15
+ "generation_max_length": 128
16
+ }
runs/hf-recognizer-smoke/package/PACKAGE.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Packaged Hugging Face OCR Candidate
2
+
3
+ Model card: `runs/hf-recognizer-smoke/package/model-card.json`
4
+ Artifacts: `runs/hf-recognizer-smoke/package/artifacts/model`
5
+
6
+ Audit before benchmarking:
7
+
8
+ ```bash
9
+ ocrtech audit-model runs/hf-recognizer-smoke/package/model-card.json
10
+ ```
runs/hf-recognizer-smoke/package/artifacts/model/config.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VisionEncoderDecoderModel"
4
+ ],
5
+ "bos_token_id": 0,
6
+ "decoder": {
7
+ "_name_or_path": "",
8
+ "activation_dropout": 0.0,
9
+ "activation_function": "relu",
10
+ "add_cross_attention": true,
11
+ "architectures": null,
12
+ "attention_dropout": 0.0,
13
+ "bos_token_id": 0,
14
+ "chunk_size_feed_forward": 0,
15
+ "classifier_dropout": 0.0,
16
+ "cross_attention_hidden_size": 384,
17
+ "d_model": 256,
18
+ "decoder_attention_heads": 8,
19
+ "decoder_ffn_dim": 1024,
20
+ "decoder_layerdrop": 0.0,
21
+ "decoder_layers": 6,
22
+ "decoder_start_token_id": 2,
23
+ "dropout": 0.1,
24
+ "dtype": "float32",
25
+ "eos_token_id": 2,
26
+ "finetuning_task": null,
27
+ "id2label": {
28
+ "0": "LABEL_0",
29
+ "1": "LABEL_1"
30
+ },
31
+ "init_std": 0.02,
32
+ "is_decoder": true,
33
+ "is_encoder_decoder": false,
34
+ "label2id": {
35
+ "LABEL_0": 0,
36
+ "LABEL_1": 1
37
+ },
38
+ "layernorm_embedding": true,
39
+ "max_position_embeddings": 512,
40
+ "model_type": "trocr",
41
+ "output_attentions": false,
42
+ "output_hidden_states": false,
43
+ "pad_token_id": 1,
44
+ "prefix": null,
45
+ "problem_type": null,
46
+ "pruned_heads": {},
47
+ "return_dict": true,
48
+ "scale_embedding": true,
49
+ "sep_token_id": null,
50
+ "task_specific_params": null,
51
+ "tie_encoder_decoder": false,
52
+ "tie_word_embeddings": false,
53
+ "tokenizer_class": null,
54
+ "torchscript": false,
55
+ "use_bfloat16": false,
56
+ "use_cache": false,
57
+ "use_learned_position_embeddings": true,
58
+ "vocab_size": 64044
59
+ },
60
+ "decoder_start_token_id": 2,
61
+ "dtype": "float32",
62
+ "encoder": {
63
+ "_name_or_path": "",
64
+ "add_cross_attention": false,
65
+ "architectures": null,
66
+ "attention_probs_dropout_prob": 0.0,
67
+ "bos_token_id": null,
68
+ "chunk_size_feed_forward": 0,
69
+ "cross_attention_hidden_size": null,
70
+ "decoder_start_token_id": null,
71
+ "dtype": "float32",
72
+ "encoder_stride": 16,
73
+ "eos_token_id": null,
74
+ "finetuning_task": null,
75
+ "hidden_act": "gelu",
76
+ "hidden_dropout_prob": 0.0,
77
+ "hidden_size": 384,
78
+ "id2label": {
79
+ "0": "LABEL_0",
80
+ "1": "LABEL_1"
81
+ },
82
+ "image_size": 384,
83
+ "initializer_range": 0.02,
84
+ "intermediate_size": 1536,
85
+ "is_decoder": false,
86
+ "is_encoder_decoder": false,
87
+ "label2id": {
88
+ "LABEL_0": 0,
89
+ "LABEL_1": 1
90
+ },
91
+ "layer_norm_eps": 1e-12,
92
+ "model_type": "deit",
93
+ "num_attention_heads": 6,
94
+ "num_channels": 3,
95
+ "num_hidden_layers": 12,
96
+ "output_attentions": false,
97
+ "output_hidden_states": false,
98
+ "pad_token_id": null,
99
+ "patch_size": 16,
100
+ "pooler_act": "tanh",
101
+ "pooler_output_size": 384,
102
+ "prefix": null,
103
+ "problem_type": null,
104
+ "pruned_heads": {},
105
+ "qkv_bias": true,
106
+ "return_dict": true,
107
+ "sep_token_id": null,
108
+ "task_specific_params": null,
109
+ "tie_encoder_decoder": false,
110
+ "tie_word_embeddings": true,
111
+ "tokenizer_class": null,
112
+ "torchscript": false,
113
+ "use_bfloat16": false
114
+ },
115
+ "eos_token_id": 2,
116
+ "is_encoder_decoder": true,
117
+ "model_type": "vision-encoder-decoder",
118
+ "pad_token_id": 1,
119
+ "tie_word_embeddings": false,
120
+ "transformers_version": "5.12.0",
121
+ "use_cache": false
122
+ }
runs/hf-recognizer-smoke/package/artifacts/model/generation_config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": false,
3
+ "assistant_confidence_threshold": 0.4,
4
+ "assistant_lookbehind": 10,
5
+ "bos_token_id": 0,
6
+ "decoder_start_token_id": 2,
7
+ "diversity_penalty": 0.0,
8
+ "do_sample": false,
9
+ "early_stopping": false,
10
+ "encoder_no_repeat_ngram_size": 0,
11
+ "encoder_repetition_penalty": 1.0,
12
+ "eos_token_id": [
13
+ 2
14
+ ],
15
+ "epsilon_cutoff": 0.0,
16
+ "eta_cutoff": 0.0,
17
+ "length_penalty": 1.0,
18
+ "max_length": 128,
19
+ "min_length": 0,
20
+ "no_repeat_ngram_size": 0,
21
+ "num_assistant_tokens": 20,
22
+ "num_assistant_tokens_schedule": "constant",
23
+ "num_beam_groups": 1,
24
+ "num_beams": 1,
25
+ "num_return_sequences": 1,
26
+ "output_scores": false,
27
+ "pad_token_id": 1,
28
+ "remove_invalid_values": false,
29
+ "repetition_penalty": 1.0,
30
+ "return_dict_in_generate": false,
31
+ "target_lookbehind": 10,
32
+ "temperature": 1.0,
33
+ "top_k": 50,
34
+ "top_p": 1.0,
35
+ "transformers_version": "5.12.0",
36
+ "typical_p": 1.0,
37
+ "use_cache": false
38
+ }
runs/hf-recognizer-smoke/package/artifacts/model/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c3ad073e00860edc0a2bf5f19f8a5dd88c01dd114f2aa94bb464de73cb68dad
3
+ size 246430696
runs/hf-recognizer-smoke/package/artifacts/model/processor_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "crop_size": {
4
+ "height": 224,
5
+ "width": 224
6
+ },
7
+ "do_center_crop": false,
8
+ "do_normalize": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "image_mean": [
12
+ 0.5,
13
+ 0.5,
14
+ 0.5
15
+ ],
16
+ "image_processor_type": "DeiTImageProcessor",
17
+ "image_std": [
18
+ 0.5,
19
+ 0.5,
20
+ 0.5
21
+ ],
22
+ "resample": 3,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "height": 384,
26
+ "width": 384
27
+ }
28
+ },
29
+ "processor_class": "TrOCRProcessor"
30
+ }
runs/hf-recognizer-smoke/package/artifacts/model/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
runs/hf-recognizer-smoke/package/artifacts/model/tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "backend": "pil",
4
+ "bos_token": "<s>",
5
+ "cls_token": "<s>",
6
+ "eos_token": "</s>",
7
+ "extra_special_tokens": [
8
+ "<s>",
9
+ "</s>"
10
+ ],
11
+ "is_local": false,
12
+ "local_files_only": false,
13
+ "mask_token": "<mask>",
14
+ "model_max_length": 1000000000000000019884624838656,
15
+ "pad_token": "<pad>",
16
+ "processor_class": "TrOCRProcessor",
17
+ "sep_token": "</s>",
18
+ "sp_model_kwargs": {},
19
+ "tokenizer_class": "XLMRobertaTokenizer",
20
+ "unk_id": 0,
21
+ "unk_token": "<unk>"
22
+ }
runs/hf-recognizer-smoke/package/artifacts/model/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a410ce8085ecd780194163c2efcb931027bd4e680e143dacf2e216a2fc59aa47
3
+ size 5329
runs/hf-recognizer-smoke/package/model-card.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_id": "ocrtech-hf-smoke",
3
+ "backend": "hf_vision_encoder_decoder",
4
+ "base_model": "microsoft/trocr-small-printed",
5
+ "created_at_utc": "2026-06-14T01:36:26.966908+00:00",
6
+ "artifacts": [
7
+ {
8
+ "path": "artifacts/model",
9
+ "required": true,
10
+ "sha256": null,
11
+ "kind": "directory"
12
+ }
13
+ ],
14
+ "backend_kwargs": {
15
+ "model_dir": "artifacts/model",
16
+ "processor_dir": "artifacts/model",
17
+ "max_new_tokens": 128
18
+ },
19
+ "provenance": {
20
+ "train_manifest": {
21
+ "path": "data/splits/train.jsonl",
22
+ "sha256": "cad84f2bcf1c9cd51c9752d4ebe587f7918e58daeecebcee2e2cae760cdbe5be"
23
+ },
24
+ "eval_manifest": {
25
+ "path": "data/splits/eval.jsonl",
26
+ "sha256": "4ce54931960cc53f593637f17d9ca18bd8d56f86b9fe2d8ea64f4f17cdfe74aa"
27
+ }
28
+ },
29
+ "metrics": {
30
+ "report": {
31
+ "path": "runs/hf-recognizer-smoke/training_metrics.json",
32
+ "sha256": "4b108200231ab363911c2321cfc370b4a422e9578bc50a73ee189913b6766f4c"
33
+ }
34
+ },
35
+ "notes": null
36
+ }
runs/hf-recognizer-smoke/training_metrics.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "eval_loss": 9.87027359008789,
3
+ "eval_cer": 19.09515372131417,
4
+ "eval_wer": 2.115873015873016,
5
+ "eval_exact_line_accuracy": 0.0,
6
+ "eval_runtime": 39.6279,
7
+ "eval_samples_per_second": 0.757,
8
+ "eval_steps_per_second": 0.379,
9
+ "epoch": 0.05952380952380952
10
+ }
runs/hf-table-figure-dev-v1/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Recognizer Training Recipe
2
+
3
+ Base model: `microsoft/trocr-small-printed`
4
+ Train manifest: `data/splits-table-figure-dev-v1/train.jsonl` (60 samples)
5
+ Eval manifest: `data/splits-table-figure-dev-v1/eval.jsonl` (20 samples)
6
+
7
+ Install the backend dependencies first:
8
+
9
+ ```bash
10
+ python -m pip install -e '.[hf-recognizer]'
11
+ ```
12
+
13
+ Run in-process:
14
+
15
+ ```bash
16
+ ocrtech train-recognizer --backend hf-vision-encoder-decoder --train-manifest data/splits-table-figure-dev-v1/train.jsonl --eval-manifest data/splits-table-figure-dev-v1/eval.jsonl --out runs/hf-table-figure-dev-v1 --run
17
+ ```
runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/config.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VisionEncoderDecoderModel"
4
+ ],
5
+ "bos_token_id": 0,
6
+ "decoder": {
7
+ "activation_dropout": 0.0,
8
+ "activation_function": "relu",
9
+ "add_cross_attention": true,
10
+ "attention_dropout": 0.0,
11
+ "classifier_dropout": 0.0,
12
+ "cross_attention_hidden_size": 384,
13
+ "d_model": 256,
14
+ "decoder_attention_heads": 8,
15
+ "decoder_ffn_dim": 1024,
16
+ "decoder_layerdrop": 0.0,
17
+ "decoder_layers": 6,
18
+ "dropout": 0.1,
19
+ "dtype": "float32",
20
+ "init_std": 0.02,
21
+ "is_decoder": true,
22
+ "layernorm_embedding": true,
23
+ "max_position_embeddings": 512,
24
+ "model_type": "trocr",
25
+ "scale_embedding": true,
26
+ "tie_word_embeddings": false,
27
+ "use_cache": false,
28
+ "use_learned_position_embeddings": true,
29
+ "vocab_size": 64044
30
+ },
31
+ "decoder_start_token_id": 2,
32
+ "dtype": "float32",
33
+ "encoder": {
34
+ "attention_probs_dropout_prob": 0.0,
35
+ "dtype": "float32",
36
+ "encoder_stride": 16,
37
+ "hidden_act": "gelu",
38
+ "hidden_dropout_prob": 0.0,
39
+ "hidden_size": 384,
40
+ "image_size": 384,
41
+ "initializer_range": 0.02,
42
+ "intermediate_size": 1536,
43
+ "layer_norm_eps": 1e-12,
44
+ "model_type": "deit",
45
+ "num_attention_heads": 6,
46
+ "num_channels": 3,
47
+ "num_hidden_layers": 12,
48
+ "patch_size": 16,
49
+ "pooler_act": "tanh",
50
+ "pooler_output_size": 384,
51
+ "qkv_bias": true
52
+ },
53
+ "eos_token_id": 2,
54
+ "is_encoder_decoder": true,
55
+ "model_type": "vision-encoder-decoder",
56
+ "pad_token_id": 1,
57
+ "tie_word_embeddings": false,
58
+ "transformers_version": "4.57.6"
59
+ }
runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/generation_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 0,
3
+ "decoder_start_token_id": 2,
4
+ "eos_token_id": [
5
+ 2
6
+ ],
7
+ "max_length": 128,
8
+ "pad_token_id": 1,
9
+ "transformers_version": "4.57.6",
10
+ "use_cache": false
11
+ }
runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:594899e3b8405b6a9797c930e6665d6fe32a52e844243fb9402eca6c11944708
3
+ size 246430696
runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/preprocessor_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 224,
4
+ "width": 224
5
+ },
6
+ "do_center_crop": false,
7
+ "do_normalize": true,
8
+ "do_rescale": true,
9
+ "do_resize": true,
10
+ "image_mean": [
11
+ 0.5,
12
+ 0.5,
13
+ 0.5
14
+ ],
15
+ "image_processor_type": "DeiTImageProcessor",
16
+ "image_std": [
17
+ 0.5,
18
+ 0.5,
19
+ 0.5
20
+ ],
21
+ "processor_class": "TrOCRProcessor",
22
+ "resample": 3,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "height": 384,
26
+ "width": 384
27
+ }
28
+ }
runs/hf-table-figure-dev-v1/checkpoints/checkpoint-15/sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4
3
+ size 1356293