voidash commited on
Commit
5f70891
·
verified ·
1 Parent(s): a8978cd

Release 74.84M Nepali Hindi English research OCR with source and native Paddle weights

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +4 -34
  2. LICENSE +17 -0
  3. README.md +102 -0
  4. THIRD_PARTY_NOTICES.md +8 -0
  5. TRAINING_DATA.md +12 -0
  6. checksums.sha256 +57 -0
  7. code/shared_character_recognizer.py +115 -0
  8. code/trocr_character_codec.py +46 -0
  9. metrics.json +117 -0
  10. paddle/bundle.json +44 -0
  11. paddle/candidate/bundle.json +2075 -0
  12. paddle/candidate/character-assets/character_codec.json +590 -0
  13. paddle/candidate/character-assets/preprocessor_config.json +28 -0
  14. paddle/candidate/english-assets/README.md +61 -0
  15. paddle/candidate/english-assets/preprocessor_config.json +19 -0
  16. paddle/candidate/english-assets/sentencepiece.bpe.model +3 -0
  17. paddle/candidate/english-assets/tokenizer_config.json +1 -0
  18. paddle/code/paddlex_shared_character.py +54 -0
  19. paddle/code/shared_character_native.py +139 -0
  20. paddle/code/trocr_character_codec.py +46 -0
  21. paddle/code/trocr_numpy_beam.py +80 -0
  22. paddle/code/trocr_paddle_norm_probe.LICENSE +96 -0
  23. paddle/code/trocr_paddle_sleef_probe.LICENSE +33 -0
  24. paddle/code/trocr_selective_onednn_pass.LICENSE +203 -0
  25. paddle/code/trocr_selective_onednn_pass.cc +52 -0
  26. paddle/code/trocr_source_cpu_ops.cc +141 -0
  27. paddle/decoders/character/decoder-step.json +0 -0
  28. paddle/decoders/character/decoder-step.pdiparams +3 -0
  29. paddle/decoders/english/decoder-step.json +0 -0
  30. paddle/decoders/english/decoder-step.pdiparams +3 -0
  31. paddle/decoders/report.json +63 -0
  32. paddle/encoder-library.so +3 -0
  33. paddle/encoder/encoder.json +0 -0
  34. paddle/encoder/encoder.pdiparams +3 -0
  35. paddle/encoder/report.json +408 -0
  36. paddle/encoder/run.json +55 -0
  37. paddle/inference.yml +33 -0
  38. predict.py +60 -0
  39. release-manifest.json +15 -0
  40. requirements-paddle.txt +7 -0
  41. requirements-source.txt +6 -0
  42. source-model/bundle.json +2075 -0
  43. source-model/character-assets/character_codec.json +590 -0
  44. source-model/character-assets/config.json +56 -0
  45. source-model/character-assets/generation_config.json +15 -0
  46. source-model/character-assets/preprocessor_config.json +28 -0
  47. source-model/character-generation.json +73 -0
  48. source-model/english-assets/README.md +61 -0
  49. source-model/english-assets/config.json +159 -0
  50. source-model/english-assets/generation_config.json +9 -0
.gitattributes CHANGED
@@ -1,35 +1,5 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
  *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  *.safetensors filter=lfs diff=lfs merge=lfs -text
2
+ *.pdiparams filter=lfs diff=lfs merge=lfs -text
3
+ *.so filter=lfs diff=lfs merge=lfs -text
4
+ paddle/candidate/english-assets/sentencepiece.bpe.model filter=lfs diff=lfs merge=lfs -text
5
+ source-model/english-assets/sentencepiece.bpe.model filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
LICENSE ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Ampixa Non-Commercial Research Release Terms
2
+
3
+ The Ampixa-authored portions of this research checkpoint and its accompanying
4
+ release utilities are made available for non-commercial research and education
5
+ only, to the extent of rights held by Ampixa. Commercial use, commercial hosting,
6
+ and incorporation in commercial products are not licensed by this release.
7
+
8
+ Retain this notice, the model card, training-data provenance and all applicable
9
+ third-party copyright and license notices when redistributing permitted portions.
10
+ Do not imply an unrestricted license for the checkpoint or its training data.
11
+ This release grants no rights to redistribute the underlying training datasets.
12
+ Third-party components remain subject to their original terms; this notice does
13
+ not replace or broaden those rights. See THIRD_PARTY_NOTICES.md and TRAINING_DATA.md.
14
+
15
+ THE RELEASE IS PROVIDED AS IS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
16
+ The authors make no guarantee of accuracy, fitness for purpose, unseen-writer
17
+ performance, or clearance of third-party rights for other uses.
README.md ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ne
4
+ - hi
5
+ - en
6
+ license: other
7
+ license_name: ampixa-non-commercial-research
8
+ license_link: LICENSE
9
+ pipeline_tag: image-to-text
10
+ base_model: microsoft/trocr-small-handwritten
11
+ tags:
12
+ - ocr
13
+ - handwriting-recognition
14
+ - devanagari
15
+ - nepali
16
+ - hindi
17
+ - pytorch
18
+ - paddleocr
19
+ - research
20
+ ---
21
+
22
+ # Ampixa Deva OCR 75M — research checkpoint
23
+
24
+ A **74,842,752-parameter** recognizer for cropped Nepali/Hindi words or lines and English handwriting. This release includes source Safetensors weights and a native Paddle/PaddleX export of the same checkpoint. Each format contains one shared encoder; the two formats are alternatives, not models to load together.
25
+
26
+ This is the established character-decoder checkpoint after an 8,000-update continuation (16,000 cumulative updates), rather than the newer experimental BPE model. It is a research release, not a claim of state-of-the-art OCR or achievement of 4% Nepali handwriting CER.
27
+
28
+ ## Measured results
29
+
30
+ | Fixed evaluation set | Crops | CER |
31
+ |---|---:|---:|
32
+ | Nepali handwriting words | 300 | 12.9921% |
33
+ | Hindi handwriting words | 2,000 | 8.0803% |
34
+ | English handwriting lines, original English branch | 976 | 2.3150% |
35
+ | English handwriting lines, character branch | 976 | 6.0940% |
36
+ | Real print crops | 2,000 | 11.1904% |
37
+ | Synthetic print crops | 800 | 2.6169% |
38
+ | English print crops, character branch | 1,744 | 13.9357% |
39
+
40
+ CER is micro-averaged NFC Unicode codepoint edit distance. Every evaluated crop is retained, including errors, empty outputs and generation caps. See `metrics.json` for exact totals and generation settings. All 8,796 native outputs from the two explicit branches matched source tokens, text, caps and errors on these fixed populations. Native evaluation performed zero Torch tensor operations.
41
+
42
+ These are existing development populations, not a blind benchmark. Nepali is word-level; it does not establish performance on unseen writers, full handwritten notes or pages. An earlier checkpoint of this architecture reached 12.53% Nepali word CER; it is not the checkpoint in this release. On a separate 336-paragraph English comparison, the retained English recognizer achieved 8.16% CER versus 3.01% for Qwen3-VL-4B. This release does not beat that stronger paragraph reference.
43
+
44
+ ## Download and source inference
45
+
46
+ ```bash
47
+ hf download ampixa/deva-ocr-75m-research --local-dir deva-ocr-75m
48
+ cd deva-ocr-75m
49
+ pip install -r requirements-source.txt
50
+ python predict.py /path/to/cropped-line.png --language ne
51
+ python predict.py /path/to/english-line.png --language en
52
+ ```
53
+
54
+ The included CLI uses serial CPU inference and does not download another model. Choose `ne`, `hi` or `en` explicitly. Nepali and Hindi use the character decoder with the adapted encoder; English uses the unchanged original English model. All branches resize each crop to 384×384 RGB. Character decoding uses 10 beams and up to 257 new tokens; English uses 10 beams and up to 256. JSON output includes text, raw token IDs and whether generation reached its cap.
55
+
56
+ This is a custom architecture. Use the included loader/CLI; `AutoModel.from_pretrained` and the generic Transformers OCR pipeline are not configured for this repository.
57
+
58
+ ## Native Paddle
59
+
60
+ Install the native dependencies in a separate environment:
61
+
62
+ ```bash
63
+ pip install -r requirements-paddle.txt
64
+ python predict.py /path/to/cropped-line.png --language ne --backend paddle
65
+ ```
66
+
67
+ The prebuilt operator library was validated on Linux x86_64 with FMA, PaddlePaddle 3.3.1 and PaddleX 3.7.1, using two CPU threads. Native GPU execution and other platforms are unvalidated. Use the source backend on platforms incompatible with the prebuilt library. The custom operator source and its third-party notices are under `paddle/code/`.
68
+
69
+ For the actual PaddleX factory:
70
+
71
+ ```python
72
+ from pathlib import Path
73
+ import sys
74
+ from paddlex.inference.models import create_predictor
75
+
76
+ root = Path("deva-ocr-75m").resolve()
77
+ sys.path.insert(0, str(root / "paddle/code"))
78
+ from paddlex_shared_character import register, MODEL_NAME
79
+ register()
80
+ predictor = create_predictor(
81
+ MODEL_NAME, model_dir=str(root / "paddle"), device="cpu",
82
+ engine="flexible", research_only_allow_unqualified=True,
83
+ )
84
+ for result in predictor.predict("cropped-line.png", branch="character"):
85
+ print(result["rec_text"])
86
+ ```
87
+
88
+ Use `branch="english"` for English. The research opt-in remains intentional: fixed-crop numerical parity does not establish full product acceptance. Scores are uncalibrated beam scores. Detection, reading order, word boxes, full-page segmentation and automatic language routing are not included.
89
+
90
+ ## Architecture and provenance
91
+
92
+ The original Microsoft TrOCR-small English model supplies the shared DeiT encoder and English decoder. The character branch applies stored rank-71 encoder corrections and a separate literal-Unicode character decoder without storing a second encoder. Source weights use Safetensors, with checksummed configuration and tokenizer assets.
93
+
94
+ `source-model/` holds source weights and their original manifest. `code/` contains the source loader and codec. `paddle/` contains the native encoder, two decoder graphs, runtime and operator library. `release-manifest.json` binds this release to its checkpoint and prior native package; `checksums.sha256` inventories published files. Packaging excludes training images and conversion-control prediction packets. Existing graph parameter files and runtime source bytes are retained.
95
+
96
+ ## Use and data terms
97
+
98
+ Use is restricted to non-commercial research and education. Training includes research-restricted IAM and IIIT handwriting sources, CC0 Nepali word crops, CC BY material, synthetic renders and internally used newspaper-derived crops. This repository does not grant rights to the underlying datasets or permission for commercial deployment. See `LICENSE`, `TRAINING_DATA.md` and `THIRD_PARTY_NOTICES.md`. No Indra or Qwen weights are included; those systems were comparators, not teachers for this checkpoint.
99
+
100
+ ## Release packaging checks
101
+
102
+ The download-layout CLI was checked on fixed Nepali, Hindi and English inputs in both backends (six exact reference matches). The actual PaddleX factory was rerun on 24 path inputs and 24 BGR inputs, with 24 JSON results checked and zero Torch tensor operations. These are packaging controls; the larger fixed-corpus accuracy results are reported above.
THIRD_PARTY_NOTICES.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Third-party notices
2
+
3
+ - Microsoft TrOCR-small-handwritten: the unchanged original English weights and architecture originate from [microsoft/trocr-small-handwritten](https://huggingface.co/microsoft/trocr-small-handwritten), whose publisher model card declares MIT. Microsoft TrOCR source is in [microsoft/unilm](https://github.com/microsoft/unilm/tree/master/trocr); its original model card is retained at `source-model/english-assets/README.md`.
4
+ - Hugging Face Transformers, PyTorch, PaddlePaddle, PaddleX, Safetensors, SentencePiece, tokenizers, Pillow and NumPy are external runtime dependencies, governed by their respective licenses.
5
+ - The native CPU operator code incorporates or adapts third-party numerical implementations. Their exact notices are retained under `paddle/code/`: `trocr_paddle_norm_probe.LICENSE`, `trocr_paddle_sleef_probe.LICENSE`, and `trocr_selective_onednn_pass.LICENSE`. Retain those files with native redistributions.
6
+ - The project-authored loader, codec and beam-search runtime retain their source comments and are supplied under the research release terms in `LICENSE`. This does not relicense third-party code or model components.
7
+
8
+ The source and native formats encode the same 74,842,752-value recognizer. Neither training datasets nor third-party comparator weights are included.
TRAINING_DATA.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Training provenance and scope
2
+
3
+ This checkpoint descends from earlier OCR experiments; its final continuation used a fixed mixture of Nepali words, IIIT Hindi words, English handwriting lines, GNHK lines, newspaper-derived print, NVIDIA English print, IIIT Hindi Unicode words and conjunct renders. Earlier ancestors also used additional word/character and synthetic replay. This is a research training lineage, not a clean-room unrestricted checkpoint.
4
+
5
+ - **Nepali handwriting words:** [Sweekar Dahal's collection](https://github.com/dahalsweekar/Nepali-Handwritten-Dataset-for-Recognition); CC0 uploader metadata. The final mixture uses 3,187 training words. Evaluation crops remain excluded from training.
6
+ - **Hindi handwriting:** [IIIT-INDIC-HW-WORDS](https://cvit.iiit.ac.in/research/projects/cvit-projects/iiit-indic-hw-words), IIIT-HW-Dev and [IIIT-Indic-HW-UC](https://cvit.iiit.ac.in/usodi/ucciohd.php). These were used in their research/education context. No unrestricted commercial grant is asserted.
7
+ - **English handwriting:** [IAM](https://fki.tic.heia-fr.ch/databases/iam-handwriting-database), used under its non-commercial research context, and [GNHK](https://www.gnhk-dataset.org/), with upstream attribution and dataset terms. Public mirrors do not broaden the original terms.
8
+ - **English synthetic print replay:** [NVIDIA OCR-Synthetic-Multilingual-v1](https://huggingface.co/datasets/nvidia/OCR-Synthetic-Multilingual-v1), attributed CC BY 4.0 material in the experiment's original source inventory. The model card does not grant ownership of these source images.
9
+ - **Nepali print:** Gorkhapatra-derived chunks were used internally with converted PDF-text silver labels. They are not newly human-verified labels or an unrestricted public dataset.
10
+ - **Synthetic text/conjunct renders:** Unicode text rendered with OFL-font families; font licenses remain separate. No font binaries are redistributed here.
11
+
12
+ Training images, image crops, label files, raw evaluation predictions and training secrets are excluded from this repository. Training on research data and publication of these research weights do not establish permission for commercial use. Obtain appropriate rights from the relevant owners before considering a separate commercial release.
checksums.sha256 ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 6914e9fe1b84a0abfe32e9a1148a9b29db07a78dc646b82416b50ee0f5f20acb .gitattributes
2
+ 37908899ed8fb456bd644323faae79bdd5b54ebdf90f07c7cf795d5ccfdd2866 LICENSE
3
+ fc0aee088bfeb7f7449f98426a6a8185e1b81e767da6da45b13016bf687fdbd6 README.md
4
+ 3beebf852bf869560dd1adabeb93be212c61a55ce002fbe2bdea2b5f8167cb68 THIRD_PARTY_NOTICES.md
5
+ d986e14af668016c081480cb05e316987bc8c519764f9f004c33db66e855a5d5 TRAINING_DATA.md
6
+ 0498d8b7d61f3c8e4a4fdcd927a507464cfaf8156bf874a211484a5474697719 code/shared_character_recognizer.py
7
+ 7ede21e57fd4985153570820873abf690cc48de2e677b38828753fbedfdbd5e2 code/trocr_character_codec.py
8
+ 965c8de2c0cf3d005ac70cb01a205f5e599fea85d888fa88f0c0164599594db7 metrics.json
9
+ 364b288087110ed4a47b6e4c0cfa1367dfcff6249c57d082b3becd472e338e58 paddle/bundle.json
10
+ 0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede paddle/candidate/bundle.json
11
+ 7bb65c86bc29b555f8da3af81b7023e370bdebe6ced8c84d104d55165c6ffb0a paddle/candidate/character-assets/character_codec.json
12
+ 36a945a7cc645688b9ef64dabae16979cf5f7c1c448569cc306694edc0598b9b paddle/candidate/character-assets/preprocessor_config.json
13
+ 7e0f183a2697956065aea4e3ec9ca718967be1b7afe446cff4dcdbc8a64fa52b paddle/candidate/english-assets/README.md
14
+ eec0c686d2e2ea6d5887f87e1c6a34ef5bf1ba5b2ac98b8675e131da646fa1d2 paddle/candidate/english-assets/preprocessor_config.json
15
+ 6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4 paddle/candidate/english-assets/sentencepiece.bpe.model
16
+ e098c98c6834fbcd3f3e75215e3e8b8868f0fe5bf07aef93d28e4f7196db293c paddle/candidate/english-assets/tokenizer_config.json
17
+ 6a7b1d60aa337ba04514c9910e68f96d1bafdff383f3779e83f22a587707a3e3 paddle/code/paddlex_shared_character.py
18
+ 394b45df79c5c4e84c2053b62b8d4080ef6a875034b6b16c661ac63257f56a30 paddle/code/shared_character_native.py
19
+ 7ede21e57fd4985153570820873abf690cc48de2e677b38828753fbedfdbd5e2 paddle/code/trocr_character_codec.py
20
+ e4f1d87113404dfc16fdddd78a1cdd6477a2f886d76cef99594fc537fc531028 paddle/code/trocr_numpy_beam.py
21
+ 19d6a3818fa4927890b59222656f155faae8f8817ebc9f40f779fdb6ab5a65d2 paddle/code/trocr_paddle_norm_probe.LICENSE
22
+ 5f35cc826b3a0001293ed62e8ea95e5784f89f5e25300bf437d34be1d35e8a75 paddle/code/trocr_paddle_sleef_probe.LICENSE
23
+ ff6311c56c1b22c9209c96cc8afc16da91c24ee55a15e14ebc46fe1960dbd856 paddle/code/trocr_selective_onednn_pass.LICENSE
24
+ ff304ef7e20f22cc1bf3c3199c6614bc3e870db640e569d465ca87c6704051b6 paddle/code/trocr_selective_onednn_pass.cc
25
+ 63bb541df8f7a1f8635c946f2407aa0f449e63cfe480cbbe6c0b8d6fb2f5f4c2 paddle/code/trocr_source_cpu_ops.cc
26
+ 555d79e651df3b22fef37f7cc873c843678c135bbe39e69488f4ef3b2acb3e5d paddle/decoders/character/decoder-step.json
27
+ e35ba8d8743abdcf8b6cdb48a572a669cbf3e504d38d2a48827b68657e32aeff paddle/decoders/character/decoder-step.pdiparams
28
+ eaea1b3b5001549a6d0a4c4b1bd810371a82bdae2092452ac2f73214762ede95 paddle/decoders/english/decoder-step.json
29
+ ec5ec71ad13c5305a1a95c8c2846c4de526571e58ce8df00fa5dbac529940a16 paddle/decoders/english/decoder-step.pdiparams
30
+ 24a40b59ddedd55f423035cb40def1e251633948a67802707d14cf3151a67ba8 paddle/decoders/report.json
31
+ eddaf1699760460ba7f2bd7fbdee9b7de9166b581e5145d9dc3c8da177bd72b7 paddle/encoder/encoder.json
32
+ b2a632ecd78bd35441f0575b5073ebdfe2dd8edebff08c892b386205655700b0 paddle/encoder/encoder.pdiparams
33
+ 6e19e7fe532e7d24d504f9e323e08d5c77e1ca07ceaeb1ebcc0f616369834dbc paddle/encoder/report.json
34
+ 42c4cf89a86fc3de900949348079f7b0c90d4e58ca2d28a105e326785a3eacd5 paddle/encoder/run.json
35
+ fce69529c6a3752247be1192a495de7d1c395f8493039ad0d17546a42f936c60 paddle/encoder-library.so
36
+ 4748d485e0280227d6b395faf8c0b956217389abb4a3c267ff6cf5d427116863 paddle/inference.yml
37
+ ec18fa5c8940fee3624d1c05e0ea4be12f1f3105a184eb03f18e7b1991a8ee7c predict.py
38
+ 0f20efb6a6b119ea4de9752b6120a19df0274c1c52621e6349e466b64b7a714b release-manifest.json
39
+ 7b26b16767a3a722eaed9b6499b3872927773a0817298bf8013a590c89e0e0bc requirements-paddle.txt
40
+ 2d2115dd37ef7dec5f883532694a7508120fe1fe20933d66bd843ff961460edf requirements-source.txt
41
+ 0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede source-model/bundle.json
42
+ 7bb65c86bc29b555f8da3af81b7023e370bdebe6ced8c84d104d55165c6ffb0a source-model/character-assets/character_codec.json
43
+ decbe7681cc6000bd5bf83226b295e7a051e8280bc12255961e011d2caadbfce source-model/character-assets/config.json
44
+ 9577d3da76b60ee97a70d1516ac144eba329a8a70dd0e96c6f721c910434dcff source-model/character-assets/generation_config.json
45
+ 36a945a7cc645688b9ef64dabae16979cf5f7c1c448569cc306694edc0598b9b source-model/character-assets/preprocessor_config.json
46
+ 02b8abbca9b3f1e5fb8ea2057b0aea84e1f488dd5dd2ca52a75850170bc3b08b source-model/character-generation.json
47
+ 7e0f183a2697956065aea4e3ec9ca718967be1b7afe446cff4dcdbc8a64fa52b source-model/english-assets/README.md
48
+ 2b6e06edec319984eca99c932d940bfa1f308db3f74d6279440b906c373bf727 source-model/english-assets/config.json
49
+ 41149cdcffec4d657f32dfcddd9b208037f01286c9e07945c724908c58ed0193 source-model/english-assets/generation_config.json
50
+ eec0c686d2e2ea6d5887f87e1c6a34ef5bf1ba5b2ac98b8675e131da646fa1d2 source-model/english-assets/preprocessor_config.json
51
+ 6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4 source-model/english-assets/sentencepiece.bpe.model
52
+ 58dc0a3d15e3bad4861bcf2dee770ea327344d185182d4c5d2bf253285e53a83 source-model/english-assets/special_tokens_map.json
53
+ e098c98c6834fbcd3f3e75215e3e8b8868f0fe5bf07aef93d28e4f7196db293c source-model/english-assets/tokenizer_config.json
54
+ cddf3683b66672c43fee2a6d966829eebf2a00c61d376d0eb30db972693210be source-model/english-generation.json
55
+ 1c598da84fcbe26af738d5ef1c0ea04f80f965e7690b1089aeaa8c7977cd4359 source-model/model-configs.json
56
+ 9b58d252978d3a5d33adcdaea95e113162daf5146e20a9e1b8aa47e21e48ed93 source-model/weights.safetensors
57
+ bf281f9f2fbabbec2885fc0556e59cc528bd2eed5f7033c20dd718bb480d9249 validation.json
code/shared_character_recognizer.py ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Research recognizer sharing one English encoder across two explicit branches.
2
+
3
+ The character branch applies saved low-rank corrections through functional_call
4
+ and supplies precomputed encoder outputs to a decoder-only VED container. No
5
+ second learned encoder is registered or saved. Functional parameter overrides
6
+ are serial CPU research operations, not a concurrent/native serving interface.
7
+ """
8
+ import copy
9
+ import hashlib
10
+ import json
11
+ from pathlib import Path
12
+
13
+ import torch
14
+ from torch import nn
15
+ from safetensors.torch import load_file
16
+ from transformers import DeiTModel, GenerationConfig, VisionEncoderDecoderConfig, VisionEncoderDecoderModel
17
+
18
+
19
+ def sha(path):
20
+ value = hashlib.sha256()
21
+ with Path(path).open('rb') as stream:
22
+ for block in iter(lambda: stream.read(1024 * 1024), b''): value.update(block)
23
+ return value.hexdigest()
24
+
25
+
26
+ def eager(config):
27
+ config._attn_implementation = 'eager'
28
+ config.encoder._attn_implementation = 'eager'
29
+ config.decoder._attn_implementation = 'eager'
30
+ return config
31
+
32
+
33
+ def load_english(folder):
34
+ config = eager(VisionEncoderDecoderConfig.from_pretrained(folder, local_files_only=True))
35
+ model, report = VisionEncoderDecoderModel.from_pretrained(folder, config=config,
36
+ encoder=DeiTModel(config.encoder, add_pooling_layer=False), local_files_only=True,
37
+ dtype=torch.float32, attn_implementation='eager', output_loading_info=True)
38
+ assert not any(report.get(k) for k in ['missing_keys', 'unexpected_keys', 'mismatched_keys', 'error_msgs'])
39
+ assert sum(p.numel() for p in model.parameters()) == 61448832
40
+ return model.eval().requires_grad_(False)
41
+
42
+
43
+ class PrecomputedOnlyEncoder(nn.Module):
44
+ main_input_name = 'pixel_values'
45
+
46
+ def __init__(self, config):
47
+ super().__init__(); self.config = copy.deepcopy(config)
48
+
49
+ def get_output_embeddings(self):
50
+ return None
51
+
52
+ def forward(self, pixel_values=None, **kwargs):
53
+ raise RuntimeError('Character decoding requires the shared encoder outputs')
54
+
55
+
56
+ class Correction(nn.Module):
57
+ def __init__(self, spec):
58
+ super().__init__(); self.spec = spec
59
+ if spec['kind'] == 'factor':
60
+ self.left = nn.Parameter(torch.empty(spec['matrix_shape'][0], spec['rank']))
61
+ self.right = nn.Parameter(torch.empty(spec['rank'], spec['matrix_shape'][1]))
62
+ else:
63
+ assert spec['kind'] == 'replacement'
64
+ self.value = nn.Parameter(torch.empty(spec['shape']))
65
+
66
+ def apply(self, base):
67
+ if self.spec['kind'] == 'replacement': return self.value
68
+ return base + (self.left @ self.right).reshape(self.spec['shape'])
69
+
70
+
71
+ class SharedCharacterRecognizer(nn.Module):
72
+ def __init__(self, original, character_decoder, character_projection, character_config,
73
+ english_generation, character_generation, specifications):
74
+ super().__init__()
75
+ self.original = original
76
+ cfg = eager(copy.deepcopy(character_config))
77
+ self.character = VisionEncoderDecoderModel(config=cfg,
78
+ encoder=PrecomputedOnlyEncoder(cfg.encoder), decoder=character_decoder)
79
+ if character_projection is not None: self.character.enc_to_dec_proj = character_projection
80
+ self.original.generation_config = copy.deepcopy(english_generation)
81
+ self.character.generation_config = copy.deepcopy(character_generation)
82
+ self.specifications = specifications
83
+ self.corrections = nn.ModuleDict({spec['key']: Correction(spec) for spec in specifications})
84
+
85
+ def generate_pixels(self, pixels, branch, generation):
86
+ if self.training: raise ValueError('Explicit eval mode is required')
87
+ if branch == 'english': return self.original.generate(pixel_values=pixels, **generation)
88
+ if branch != 'character': raise ValueError('Require an explicit English or character branch')
89
+ base = self.original.encoder.state_dict()
90
+ overrides = {spec['name']: self.corrections[spec['key']].apply(base[spec['name']])
91
+ for spec in self.specifications}
92
+ output = torch.func.functional_call(self.original.encoder, overrides, (),
93
+ dict(pixel_values=pixels, return_dict=True), strict=False)
94
+ return self.character.generate(encoder_outputs=output, **generation)
95
+
96
+ @classmethod
97
+ def from_bundle(cls, folder):
98
+ folder = Path(folder); manifest = json.loads((folder / 'bundle.json').read_text())
99
+ for name, expected in manifest['files_sha256'].items(): assert sha(folder / name) == expected
100
+ configs = json.loads((folder / 'model-configs.json').read_text())
101
+ english = eager(VisionEncoderDecoderConfig.from_dict(configs['english']))
102
+ character = eager(VisionEncoderDecoderConfig.from_dict(configs['character']))
103
+ original = VisionEncoderDecoderModel(config=english,
104
+ encoder=DeiTModel(english.encoder, add_pooling_layer=False))
105
+ private = VisionEncoderDecoderModel(config=character,
106
+ encoder=PrecomputedOnlyEncoder(character.encoder))
107
+ model = cls(original, private.decoder, getattr(private, 'enc_to_dec_proj', None), character,
108
+ GenerationConfig.from_pretrained(folder, config_file_name='english-generation.json', local_files_only=True),
109
+ GenerationConfig.from_pretrained(folder, config_file_name='character-generation.json', local_files_only=True),
110
+ manifest['corrections'])
111
+ result = model.load_state_dict(load_file(str(folder / 'weights.safetensors')), strict=True)
112
+ assert not result.missing_keys and not result.unexpected_keys
113
+ assert sum(p.numel() for p in model.parameters()) == manifest['parameters'] == 74842752
114
+ assert len(model.character.encoder.state_dict()) == 0
115
+ return model.eval().requires_grad_(False)
code/trocr_character_codec.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Literal NFC character codec for the experimental compact TrOCR decoder.
2
+
3
+ Tokenizer BOS0 is serialization only; training targets exclude it. Generation
4
+ starts with EOS2 and suppresses BOS/PAD/UNK. Unknown outputs remain visible as
5
+ replacement characters when decoded, never silently removed.
6
+ """
7
+ import unicodedata
8
+
9
+
10
+ class CharacterCodec:
11
+ def __init__(self, characters):
12
+ if len(characters) != len(set(characters)) or any(len(c) != 1 for c in characters):
13
+ raise ValueError('Require ordered, unique Unicode codepoints')
14
+ self.characters = list(characters)
15
+ self.native = set(characters)
16
+ self.character_ids = {c: i + 4 for i, c in enumerate(characters)}
17
+ self.id_characters = {i: c for c, i in self.character_ids.items()}
18
+ self.classes = len(characters) + 4
19
+
20
+ def encode(self, text):
21
+ if not text or text != unicodedata.normalize('NFC', text).strip():
22
+ raise ValueError('Require nonempty, stripped NFC text')
23
+ if any(c not in self.native for c in text):
24
+ raise ValueError('Text outside the fixed OCR alphabet')
25
+ return [0, *[self.character_ids[c] for c in text], 2], 'characters'
26
+
27
+ def decode(self, ids):
28
+ pieces = []
29
+ for index in ids:
30
+ if index in [0, 1, 2]:
31
+ continue
32
+ if index == 3:
33
+ pieces.append('\ufffd')
34
+ elif index in self.id_characters:
35
+ pieces.append(self.id_characters[index])
36
+ else:
37
+ raise ValueError('Unassigned character output ID')
38
+ return unicodedata.normalize('NFC', ''.join(pieces))
39
+
40
+ def manifest(self):
41
+ return {'version': 1, 'kind': 'literal_NFC_characters', 'classes': self.classes,
42
+ 'special_ids': {'BOS_serialization': 0, 'PAD': 1, 'EOS_and_decoder_start': 2, 'UNK': 3},
43
+ 'character_ids': self.character_ids, 'generation_suppressed_ids': [0, 1, 3],
44
+ 'training_target': 'Drop serialization BOS0 only; retain every text codepoint and EOS2',
45
+ 'unknown_output': 'Decode3 as U+FFFD, never silently remove it',
46
+ 'scope': 'Experimental codec, not recognition quality or Paddle qualification.'}
metrics.json ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "physical_neural_values_per_format": 74842752,
3
+ "metrics": {
4
+ "character": {
5
+ "images": 7820,
6
+ "sets": {
7
+ "hw_nep_dev": {
8
+ "images": 300,
9
+ "chars": 1524,
10
+ "edits": 198,
11
+ "exact": 196,
12
+ "failed": 0,
13
+ "empty": 0,
14
+ "capped": 0,
15
+ "CER": 0.12992125984251968
16
+ },
17
+ "hw_hindi_dev": {
18
+ "images": 2000,
19
+ "chars": 12054,
20
+ "edits": 974,
21
+ "exact": 1440,
22
+ "failed": 0,
23
+ "empty": 0,
24
+ "capped": 0,
25
+ "CER": 0.08080305292848847
26
+ },
27
+ "hw_en_dev": {
28
+ "images": 976,
29
+ "chars": 42074,
30
+ "edits": 2564,
31
+ "exact": 219,
32
+ "failed": 0,
33
+ "empty": 0,
34
+ "capped": 0,
35
+ "CER": 0.06094024813423967
36
+ },
37
+ "real_dev": {
38
+ "images": 2000,
39
+ "chars": 43430,
40
+ "edits": 4860,
41
+ "exact": 1618,
42
+ "failed": 0,
43
+ "empty": 0,
44
+ "capped": 0,
45
+ "CER": 0.11190421367718167
46
+ },
47
+ "synth_dev": {
48
+ "images": 800,
49
+ "chars": 10050,
50
+ "edits": 263,
51
+ "exact": 675,
52
+ "failed": 0,
53
+ "empty": 0,
54
+ "capped": 0,
55
+ "CER": 0.026169154228855723
56
+ },
57
+ "en_dev": {
58
+ "images": 1744,
59
+ "chars": 46033,
60
+ "edits": 6415,
61
+ "exact": 908,
62
+ "failed": 0,
63
+ "empty": 0,
64
+ "capped": 0,
65
+ "CER": 0.13935654856298743
66
+ }
67
+ },
68
+ "generation": {
69
+ "do_sample": false,
70
+ "num_beams": 10,
71
+ "max_new_tokens": 257,
72
+ "min_length": 0,
73
+ "length_penalty": 1.0,
74
+ "early_stopping": false,
75
+ "use_cache": true,
76
+ "suppress_tokens": [
77
+ 0,
78
+ 1,
79
+ 3
80
+ ]
81
+ },
82
+ "native_source_exact": true,
83
+ "verification_sha256": "7df9ebd369fd4e323039639f1ce9602f95193e0d6a42fc20cba37ece7f052e1b"
84
+ },
85
+ "english": {
86
+ "images": 976,
87
+ "sets": {
88
+ "hw_en_dev": {
89
+ "images": 976,
90
+ "chars": 42074,
91
+ "edits": 974,
92
+ "exact": 605,
93
+ "failed": 0,
94
+ "empty": 0,
95
+ "capped": 0,
96
+ "CER": 0.023149688643818035
97
+ }
98
+ },
99
+ "generation": {
100
+ "do_sample": false,
101
+ "num_beams": 10,
102
+ "max_new_tokens": 256,
103
+ "min_length": 0,
104
+ "length_penalty": 1.0,
105
+ "early_stopping": false,
106
+ "use_cache": true
107
+ },
108
+ "native_source_exact": true,
109
+ "verification_sha256": "daa40c7506e76966acaa17313a015c4b7badb904a15aebd9ab5a26371b6098ab"
110
+ }
111
+ },
112
+ "normalization": "NFC codepoint CER; all samples, failures, empties and caps retained",
113
+ "explicit_language_branch": true,
114
+ "automatic_routing": false,
115
+ "blind_unseen_writer_page_evaluation": false,
116
+ "handwriting_4percent_target_achieved": false
117
+ }
paddle/bundle.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "scope": "Package only native graph parameters and required assets for PaddleX research.\n\nNo source Torch weights or training controls are included. Relocation and\nPaddleX path/BGR/result behavior require a separate actual-factory audit.\n",
3
+ "config_sha256": "4748d485e0280227d6b395faf8c0b956217389abb4a3c267ff6cf5d427116863",
4
+ "assets_sha256": {
5
+ "candidate/bundle.json": "0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede",
6
+ "candidate/character-assets/character_codec.json": "7bb65c86bc29b555f8da3af81b7023e370bdebe6ced8c84d104d55165c6ffb0a",
7
+ "candidate/character-assets/preprocessor_config.json": "36a945a7cc645688b9ef64dabae16979cf5f7c1c448569cc306694edc0598b9b",
8
+ "candidate/english-assets/sentencepiece.bpe.model": "6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4",
9
+ "candidate/english-assets/tokenizer_config.json": "e098c98c6834fbcd3f3e75215e3e8b8868f0fe5bf07aef93d28e4f7196db293c",
10
+ "candidate/english-assets/preprocessor_config.json": "eec0c686d2e2ea6d5887f87e1c6a34ef5bf1ba5b2ac98b8675e131da646fa1d2",
11
+ "candidate/english-assets/README.md": "7e0f183a2697956065aea4e3ec9ca718967be1b7afe446cff4dcdbc8a64fa52b",
12
+ "encoder/encoder.json": "eddaf1699760460ba7f2bd7fbdee9b7de9166b581e5145d9dc3c8da177bd72b7",
13
+ "encoder/encoder.pdiparams": "b2a632ecd78bd35441f0575b5073ebdfe2dd8edebff08c892b386205655700b0",
14
+ "encoder/report.json": "6e19e7fe532e7d24d504f9e323e08d5c77e1ca07ceaeb1ebcc0f616369834dbc",
15
+ "encoder/run.json": "42c4cf89a86fc3de900949348079f7b0c90d4e58ca2d28a105e326785a3eacd5",
16
+ "decoders/report.json": "24a40b59ddedd55f423035cb40def1e251633948a67802707d14cf3151a67ba8",
17
+ "decoders/english/decoder-step.json": "eaea1b3b5001549a6d0a4c4b1bd810371a82bdae2092452ac2f73214762ede95",
18
+ "decoders/english/decoder-step.pdiparams": "ec5ec71ad13c5305a1a95c8c2846c4de526571e58ce8df00fa5dbac529940a16",
19
+ "decoders/character/decoder-step.json": "555d79e651df3b22fef37f7cc873c843678c135bbe39e69488f4ef3b2acb3e5d",
20
+ "decoders/character/decoder-step.pdiparams": "e35ba8d8743abdcf8b6cdb48a572a669cbf3e504d38d2a48827b68657e32aeff",
21
+ "encoder-library.so": "fce69529c6a3752247be1192a495de7d1c395f8493039ad0d17546a42f936c60",
22
+ "code/paddlex_shared_character.py": "6a7b1d60aa337ba04514c9910e68f96d1bafdff383f3779e83f22a587707a3e3",
23
+ "code/shared_character_native.py": "394b45df79c5c4e84c2053b62b8d4080ef6a875034b6b16c661ac63257f56a30",
24
+ "code/trocr_character_codec.py": "7ede21e57fd4985153570820873abf690cc48de2e677b38828753fbedfdbd5e2",
25
+ "code/trocr_numpy_beam.py": "e4f1d87113404dfc16fdddd78a1cdd6477a2f886d76cef99594fc537fc531028",
26
+ "code/trocr_source_cpu_ops.cc": "63bb541df8f7a1f8635c946f2407aa0f449e63cfe480cbbe6c0b8d6fb2f5f4c2",
27
+ "code/trocr_selective_onednn_pass.cc": "ff304ef7e20f22cc1bf3c3199c6614bc3e870db640e569d465ca87c6704051b6",
28
+ "code/trocr_paddle_norm_probe.LICENSE": "19d6a3818fa4927890b59222656f155faae8f8817ebc9f40f779fdb6ab5a65d2",
29
+ "code/trocr_paddle_sleef_probe.LICENSE": "5f35cc826b3a0001293ed62e8ea95e5784f89f5e25300bf437d34be1d35e8a75",
30
+ "code/trocr_selective_onednn_pass.LICENSE": "ff6311c56c1b22c9209c96cc8afc16da91c24ee55a15e14ebc46fe1960dbd856"
31
+ },
32
+ "parameters": 74842752,
33
+ "source_Torch_weights_included": false,
34
+ "second_encoder_stored": false,
35
+ "native_generation_report_sha256": "63682d42f3edd72df566613a546aef35d86cc4a9580873a823132a3736e86722",
36
+ "runtime_change_since_direct_controls": "Library relocation argument, RGB preprocessing helper and graph-path diagnostics; actual factory audit is mandatory.",
37
+ "source_sha256": "d2d2338a9d8efafde6d1bb8995addba0c7482976ffb2dae3481de41433acc2b4",
38
+ "factory_contract_qualified": false,
39
+ "native_Paddle_qualified": false,
40
+ "PaddleX_qualified": false,
41
+ "model_promoted": false,
42
+ "public_release_parent_bundle_sha256": "7f4091be58fc6398363d7a192fab73af6832a543a193efada11b91f188e7d120",
43
+ "public_packaging_change": "Exclude conversion-control predictions; graph parameters, runtime sources, required identity reports and text assets unchanged."
44
+ }
paddle/candidate/bundle.json ADDED
@@ -0,0 +1,2075 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format": "shared-character-private-continuation-source-v1",
3
+ "parameters": 74842752,
4
+ "corrections": [
5
+ {
6
+ "key": "t000",
7
+ "name": "embeddings.cls_token",
8
+ "shape": [
9
+ 1,
10
+ 1,
11
+ 384
12
+ ],
13
+ "kind": "replacement"
14
+ },
15
+ {
16
+ "key": "t001",
17
+ "name": "embeddings.distillation_token",
18
+ "shape": [
19
+ 1,
20
+ 1,
21
+ 384
22
+ ],
23
+ "kind": "replacement"
24
+ },
25
+ {
26
+ "key": "t002",
27
+ "name": "embeddings.patch_embeddings.projection.bias",
28
+ "shape": [
29
+ 384
30
+ ],
31
+ "kind": "replacement"
32
+ },
33
+ {
34
+ "key": "t003",
35
+ "name": "embeddings.patch_embeddings.projection.weight",
36
+ "shape": [
37
+ 384,
38
+ 3,
39
+ 16,
40
+ 16
41
+ ],
42
+ "kind": "factor",
43
+ "rank": 71,
44
+ "matrix_shape": [
45
+ 384,
46
+ 768
47
+ ]
48
+ },
49
+ {
50
+ "key": "t004",
51
+ "name": "embeddings.position_embeddings",
52
+ "shape": [
53
+ 1,
54
+ 578,
55
+ 384
56
+ ],
57
+ "kind": "replacement"
58
+ },
59
+ {
60
+ "key": "t005",
61
+ "name": "encoder.layer.0.attention.attention.key.bias",
62
+ "shape": [
63
+ 384
64
+ ],
65
+ "kind": "replacement"
66
+ },
67
+ {
68
+ "key": "t006",
69
+ "name": "encoder.layer.0.attention.attention.key.weight",
70
+ "shape": [
71
+ 384,
72
+ 384
73
+ ],
74
+ "kind": "factor",
75
+ "rank": 71,
76
+ "matrix_shape": [
77
+ 384,
78
+ 384
79
+ ]
80
+ },
81
+ {
82
+ "key": "t007",
83
+ "name": "encoder.layer.0.attention.attention.query.bias",
84
+ "shape": [
85
+ 384
86
+ ],
87
+ "kind": "replacement"
88
+ },
89
+ {
90
+ "key": "t008",
91
+ "name": "encoder.layer.0.attention.attention.query.weight",
92
+ "shape": [
93
+ 384,
94
+ 384
95
+ ],
96
+ "kind": "factor",
97
+ "rank": 71,
98
+ "matrix_shape": [
99
+ 384,
100
+ 384
101
+ ]
102
+ },
103
+ {
104
+ "key": "t009",
105
+ "name": "encoder.layer.0.attention.attention.value.bias",
106
+ "shape": [
107
+ 384
108
+ ],
109
+ "kind": "replacement"
110
+ },
111
+ {
112
+ "key": "t010",
113
+ "name": "encoder.layer.0.attention.attention.value.weight",
114
+ "shape": [
115
+ 384,
116
+ 384
117
+ ],
118
+ "kind": "factor",
119
+ "rank": 71,
120
+ "matrix_shape": [
121
+ 384,
122
+ 384
123
+ ]
124
+ },
125
+ {
126
+ "key": "t011",
127
+ "name": "encoder.layer.0.attention.output.dense.bias",
128
+ "shape": [
129
+ 384
130
+ ],
131
+ "kind": "replacement"
132
+ },
133
+ {
134
+ "key": "t012",
135
+ "name": "encoder.layer.0.attention.output.dense.weight",
136
+ "shape": [
137
+ 384,
138
+ 384
139
+ ],
140
+ "kind": "factor",
141
+ "rank": 71,
142
+ "matrix_shape": [
143
+ 384,
144
+ 384
145
+ ]
146
+ },
147
+ {
148
+ "key": "t013",
149
+ "name": "encoder.layer.0.intermediate.dense.bias",
150
+ "shape": [
151
+ 1536
152
+ ],
153
+ "kind": "replacement"
154
+ },
155
+ {
156
+ "key": "t014",
157
+ "name": "encoder.layer.0.intermediate.dense.weight",
158
+ "shape": [
159
+ 1536,
160
+ 384
161
+ ],
162
+ "kind": "factor",
163
+ "rank": 71,
164
+ "matrix_shape": [
165
+ 1536,
166
+ 384
167
+ ]
168
+ },
169
+ {
170
+ "key": "t015",
171
+ "name": "encoder.layer.0.layernorm_after.bias",
172
+ "shape": [
173
+ 384
174
+ ],
175
+ "kind": "replacement"
176
+ },
177
+ {
178
+ "key": "t016",
179
+ "name": "encoder.layer.0.layernorm_after.weight",
180
+ "shape": [
181
+ 384
182
+ ],
183
+ "kind": "replacement"
184
+ },
185
+ {
186
+ "key": "t017",
187
+ "name": "encoder.layer.0.layernorm_before.bias",
188
+ "shape": [
189
+ 384
190
+ ],
191
+ "kind": "replacement"
192
+ },
193
+ {
194
+ "key": "t018",
195
+ "name": "encoder.layer.0.layernorm_before.weight",
196
+ "shape": [
197
+ 384
198
+ ],
199
+ "kind": "replacement"
200
+ },
201
+ {
202
+ "key": "t019",
203
+ "name": "encoder.layer.0.output.dense.bias",
204
+ "shape": [
205
+ 384
206
+ ],
207
+ "kind": "replacement"
208
+ },
209
+ {
210
+ "key": "t020",
211
+ "name": "encoder.layer.0.output.dense.weight",
212
+ "shape": [
213
+ 384,
214
+ 1536
215
+ ],
216
+ "kind": "factor",
217
+ "rank": 71,
218
+ "matrix_shape": [
219
+ 384,
220
+ 1536
221
+ ]
222
+ },
223
+ {
224
+ "key": "t021",
225
+ "name": "encoder.layer.1.attention.attention.key.bias",
226
+ "shape": [
227
+ 384
228
+ ],
229
+ "kind": "replacement"
230
+ },
231
+ {
232
+ "key": "t022",
233
+ "name": "encoder.layer.1.attention.attention.key.weight",
234
+ "shape": [
235
+ 384,
236
+ 384
237
+ ],
238
+ "kind": "factor",
239
+ "rank": 71,
240
+ "matrix_shape": [
241
+ 384,
242
+ 384
243
+ ]
244
+ },
245
+ {
246
+ "key": "t023",
247
+ "name": "encoder.layer.1.attention.attention.query.bias",
248
+ "shape": [
249
+ 384
250
+ ],
251
+ "kind": "replacement"
252
+ },
253
+ {
254
+ "key": "t024",
255
+ "name": "encoder.layer.1.attention.attention.query.weight",
256
+ "shape": [
257
+ 384,
258
+ 384
259
+ ],
260
+ "kind": "factor",
261
+ "rank": 71,
262
+ "matrix_shape": [
263
+ 384,
264
+ 384
265
+ ]
266
+ },
267
+ {
268
+ "key": "t025",
269
+ "name": "encoder.layer.1.attention.attention.value.bias",
270
+ "shape": [
271
+ 384
272
+ ],
273
+ "kind": "replacement"
274
+ },
275
+ {
276
+ "key": "t026",
277
+ "name": "encoder.layer.1.attention.attention.value.weight",
278
+ "shape": [
279
+ 384,
280
+ 384
281
+ ],
282
+ "kind": "factor",
283
+ "rank": 71,
284
+ "matrix_shape": [
285
+ 384,
286
+ 384
287
+ ]
288
+ },
289
+ {
290
+ "key": "t027",
291
+ "name": "encoder.layer.1.attention.output.dense.bias",
292
+ "shape": [
293
+ 384
294
+ ],
295
+ "kind": "replacement"
296
+ },
297
+ {
298
+ "key": "t028",
299
+ "name": "encoder.layer.1.attention.output.dense.weight",
300
+ "shape": [
301
+ 384,
302
+ 384
303
+ ],
304
+ "kind": "factor",
305
+ "rank": 71,
306
+ "matrix_shape": [
307
+ 384,
308
+ 384
309
+ ]
310
+ },
311
+ {
312
+ "key": "t029",
313
+ "name": "encoder.layer.1.intermediate.dense.bias",
314
+ "shape": [
315
+ 1536
316
+ ],
317
+ "kind": "replacement"
318
+ },
319
+ {
320
+ "key": "t030",
321
+ "name": "encoder.layer.1.intermediate.dense.weight",
322
+ "shape": [
323
+ 1536,
324
+ 384
325
+ ],
326
+ "kind": "factor",
327
+ "rank": 71,
328
+ "matrix_shape": [
329
+ 1536,
330
+ 384
331
+ ]
332
+ },
333
+ {
334
+ "key": "t031",
335
+ "name": "encoder.layer.1.layernorm_after.bias",
336
+ "shape": [
337
+ 384
338
+ ],
339
+ "kind": "replacement"
340
+ },
341
+ {
342
+ "key": "t032",
343
+ "name": "encoder.layer.1.layernorm_after.weight",
344
+ "shape": [
345
+ 384
346
+ ],
347
+ "kind": "replacement"
348
+ },
349
+ {
350
+ "key": "t033",
351
+ "name": "encoder.layer.1.layernorm_before.bias",
352
+ "shape": [
353
+ 384
354
+ ],
355
+ "kind": "replacement"
356
+ },
357
+ {
358
+ "key": "t034",
359
+ "name": "encoder.layer.1.layernorm_before.weight",
360
+ "shape": [
361
+ 384
362
+ ],
363
+ "kind": "replacement"
364
+ },
365
+ {
366
+ "key": "t035",
367
+ "name": "encoder.layer.1.output.dense.bias",
368
+ "shape": [
369
+ 384
370
+ ],
371
+ "kind": "replacement"
372
+ },
373
+ {
374
+ "key": "t036",
375
+ "name": "encoder.layer.1.output.dense.weight",
376
+ "shape": [
377
+ 384,
378
+ 1536
379
+ ],
380
+ "kind": "factor",
381
+ "rank": 71,
382
+ "matrix_shape": [
383
+ 384,
384
+ 1536
385
+ ]
386
+ },
387
+ {
388
+ "key": "t037",
389
+ "name": "encoder.layer.10.attention.attention.key.bias",
390
+ "shape": [
391
+ 384
392
+ ],
393
+ "kind": "replacement"
394
+ },
395
+ {
396
+ "key": "t038",
397
+ "name": "encoder.layer.10.attention.attention.key.weight",
398
+ "shape": [
399
+ 384,
400
+ 384
401
+ ],
402
+ "kind": "factor",
403
+ "rank": 71,
404
+ "matrix_shape": [
405
+ 384,
406
+ 384
407
+ ]
408
+ },
409
+ {
410
+ "key": "t039",
411
+ "name": "encoder.layer.10.attention.attention.query.bias",
412
+ "shape": [
413
+ 384
414
+ ],
415
+ "kind": "replacement"
416
+ },
417
+ {
418
+ "key": "t040",
419
+ "name": "encoder.layer.10.attention.attention.query.weight",
420
+ "shape": [
421
+ 384,
422
+ 384
423
+ ],
424
+ "kind": "factor",
425
+ "rank": 71,
426
+ "matrix_shape": [
427
+ 384,
428
+ 384
429
+ ]
430
+ },
431
+ {
432
+ "key": "t041",
433
+ "name": "encoder.layer.10.attention.attention.value.bias",
434
+ "shape": [
435
+ 384
436
+ ],
437
+ "kind": "replacement"
438
+ },
439
+ {
440
+ "key": "t042",
441
+ "name": "encoder.layer.10.attention.attention.value.weight",
442
+ "shape": [
443
+ 384,
444
+ 384
445
+ ],
446
+ "kind": "factor",
447
+ "rank": 71,
448
+ "matrix_shape": [
449
+ 384,
450
+ 384
451
+ ]
452
+ },
453
+ {
454
+ "key": "t043",
455
+ "name": "encoder.layer.10.attention.output.dense.bias",
456
+ "shape": [
457
+ 384
458
+ ],
459
+ "kind": "replacement"
460
+ },
461
+ {
462
+ "key": "t044",
463
+ "name": "encoder.layer.10.attention.output.dense.weight",
464
+ "shape": [
465
+ 384,
466
+ 384
467
+ ],
468
+ "kind": "factor",
469
+ "rank": 71,
470
+ "matrix_shape": [
471
+ 384,
472
+ 384
473
+ ]
474
+ },
475
+ {
476
+ "key": "t045",
477
+ "name": "encoder.layer.10.intermediate.dense.bias",
478
+ "shape": [
479
+ 1536
480
+ ],
481
+ "kind": "replacement"
482
+ },
483
+ {
484
+ "key": "t046",
485
+ "name": "encoder.layer.10.intermediate.dense.weight",
486
+ "shape": [
487
+ 1536,
488
+ 384
489
+ ],
490
+ "kind": "factor",
491
+ "rank": 71,
492
+ "matrix_shape": [
493
+ 1536,
494
+ 384
495
+ ]
496
+ },
497
+ {
498
+ "key": "t047",
499
+ "name": "encoder.layer.10.layernorm_after.bias",
500
+ "shape": [
501
+ 384
502
+ ],
503
+ "kind": "replacement"
504
+ },
505
+ {
506
+ "key": "t048",
507
+ "name": "encoder.layer.10.layernorm_after.weight",
508
+ "shape": [
509
+ 384
510
+ ],
511
+ "kind": "replacement"
512
+ },
513
+ {
514
+ "key": "t049",
515
+ "name": "encoder.layer.10.layernorm_before.bias",
516
+ "shape": [
517
+ 384
518
+ ],
519
+ "kind": "replacement"
520
+ },
521
+ {
522
+ "key": "t050",
523
+ "name": "encoder.layer.10.layernorm_before.weight",
524
+ "shape": [
525
+ 384
526
+ ],
527
+ "kind": "replacement"
528
+ },
529
+ {
530
+ "key": "t051",
531
+ "name": "encoder.layer.10.output.dense.bias",
532
+ "shape": [
533
+ 384
534
+ ],
535
+ "kind": "replacement"
536
+ },
537
+ {
538
+ "key": "t052",
539
+ "name": "encoder.layer.10.output.dense.weight",
540
+ "shape": [
541
+ 384,
542
+ 1536
543
+ ],
544
+ "kind": "factor",
545
+ "rank": 71,
546
+ "matrix_shape": [
547
+ 384,
548
+ 1536
549
+ ]
550
+ },
551
+ {
552
+ "key": "t053",
553
+ "name": "encoder.layer.11.attention.attention.key.bias",
554
+ "shape": [
555
+ 384
556
+ ],
557
+ "kind": "replacement"
558
+ },
559
+ {
560
+ "key": "t054",
561
+ "name": "encoder.layer.11.attention.attention.key.weight",
562
+ "shape": [
563
+ 384,
564
+ 384
565
+ ],
566
+ "kind": "factor",
567
+ "rank": 71,
568
+ "matrix_shape": [
569
+ 384,
570
+ 384
571
+ ]
572
+ },
573
+ {
574
+ "key": "t055",
575
+ "name": "encoder.layer.11.attention.attention.query.bias",
576
+ "shape": [
577
+ 384
578
+ ],
579
+ "kind": "replacement"
580
+ },
581
+ {
582
+ "key": "t056",
583
+ "name": "encoder.layer.11.attention.attention.query.weight",
584
+ "shape": [
585
+ 384,
586
+ 384
587
+ ],
588
+ "kind": "factor",
589
+ "rank": 71,
590
+ "matrix_shape": [
591
+ 384,
592
+ 384
593
+ ]
594
+ },
595
+ {
596
+ "key": "t057",
597
+ "name": "encoder.layer.11.attention.attention.value.bias",
598
+ "shape": [
599
+ 384
600
+ ],
601
+ "kind": "replacement"
602
+ },
603
+ {
604
+ "key": "t058",
605
+ "name": "encoder.layer.11.attention.attention.value.weight",
606
+ "shape": [
607
+ 384,
608
+ 384
609
+ ],
610
+ "kind": "factor",
611
+ "rank": 71,
612
+ "matrix_shape": [
613
+ 384,
614
+ 384
615
+ ]
616
+ },
617
+ {
618
+ "key": "t059",
619
+ "name": "encoder.layer.11.attention.output.dense.bias",
620
+ "shape": [
621
+ 384
622
+ ],
623
+ "kind": "replacement"
624
+ },
625
+ {
626
+ "key": "t060",
627
+ "name": "encoder.layer.11.attention.output.dense.weight",
628
+ "shape": [
629
+ 384,
630
+ 384
631
+ ],
632
+ "kind": "factor",
633
+ "rank": 71,
634
+ "matrix_shape": [
635
+ 384,
636
+ 384
637
+ ]
638
+ },
639
+ {
640
+ "key": "t061",
641
+ "name": "encoder.layer.11.intermediate.dense.bias",
642
+ "shape": [
643
+ 1536
644
+ ],
645
+ "kind": "replacement"
646
+ },
647
+ {
648
+ "key": "t062",
649
+ "name": "encoder.layer.11.intermediate.dense.weight",
650
+ "shape": [
651
+ 1536,
652
+ 384
653
+ ],
654
+ "kind": "factor",
655
+ "rank": 71,
656
+ "matrix_shape": [
657
+ 1536,
658
+ 384
659
+ ]
660
+ },
661
+ {
662
+ "key": "t063",
663
+ "name": "encoder.layer.11.layernorm_after.bias",
664
+ "shape": [
665
+ 384
666
+ ],
667
+ "kind": "replacement"
668
+ },
669
+ {
670
+ "key": "t064",
671
+ "name": "encoder.layer.11.layernorm_after.weight",
672
+ "shape": [
673
+ 384
674
+ ],
675
+ "kind": "replacement"
676
+ },
677
+ {
678
+ "key": "t065",
679
+ "name": "encoder.layer.11.layernorm_before.bias",
680
+ "shape": [
681
+ 384
682
+ ],
683
+ "kind": "replacement"
684
+ },
685
+ {
686
+ "key": "t066",
687
+ "name": "encoder.layer.11.layernorm_before.weight",
688
+ "shape": [
689
+ 384
690
+ ],
691
+ "kind": "replacement"
692
+ },
693
+ {
694
+ "key": "t067",
695
+ "name": "encoder.layer.11.output.dense.bias",
696
+ "shape": [
697
+ 384
698
+ ],
699
+ "kind": "replacement"
700
+ },
701
+ {
702
+ "key": "t068",
703
+ "name": "encoder.layer.11.output.dense.weight",
704
+ "shape": [
705
+ 384,
706
+ 1536
707
+ ],
708
+ "kind": "factor",
709
+ "rank": 71,
710
+ "matrix_shape": [
711
+ 384,
712
+ 1536
713
+ ]
714
+ },
715
+ {
716
+ "key": "t069",
717
+ "name": "encoder.layer.2.attention.attention.key.bias",
718
+ "shape": [
719
+ 384
720
+ ],
721
+ "kind": "replacement"
722
+ },
723
+ {
724
+ "key": "t070",
725
+ "name": "encoder.layer.2.attention.attention.key.weight",
726
+ "shape": [
727
+ 384,
728
+ 384
729
+ ],
730
+ "kind": "factor",
731
+ "rank": 71,
732
+ "matrix_shape": [
733
+ 384,
734
+ 384
735
+ ]
736
+ },
737
+ {
738
+ "key": "t071",
739
+ "name": "encoder.layer.2.attention.attention.query.bias",
740
+ "shape": [
741
+ 384
742
+ ],
743
+ "kind": "replacement"
744
+ },
745
+ {
746
+ "key": "t072",
747
+ "name": "encoder.layer.2.attention.attention.query.weight",
748
+ "shape": [
749
+ 384,
750
+ 384
751
+ ],
752
+ "kind": "factor",
753
+ "rank": 71,
754
+ "matrix_shape": [
755
+ 384,
756
+ 384
757
+ ]
758
+ },
759
+ {
760
+ "key": "t073",
761
+ "name": "encoder.layer.2.attention.attention.value.bias",
762
+ "shape": [
763
+ 384
764
+ ],
765
+ "kind": "replacement"
766
+ },
767
+ {
768
+ "key": "t074",
769
+ "name": "encoder.layer.2.attention.attention.value.weight",
770
+ "shape": [
771
+ 384,
772
+ 384
773
+ ],
774
+ "kind": "factor",
775
+ "rank": 71,
776
+ "matrix_shape": [
777
+ 384,
778
+ 384
779
+ ]
780
+ },
781
+ {
782
+ "key": "t075",
783
+ "name": "encoder.layer.2.attention.output.dense.bias",
784
+ "shape": [
785
+ 384
786
+ ],
787
+ "kind": "replacement"
788
+ },
789
+ {
790
+ "key": "t076",
791
+ "name": "encoder.layer.2.attention.output.dense.weight",
792
+ "shape": [
793
+ 384,
794
+ 384
795
+ ],
796
+ "kind": "factor",
797
+ "rank": 71,
798
+ "matrix_shape": [
799
+ 384,
800
+ 384
801
+ ]
802
+ },
803
+ {
804
+ "key": "t077",
805
+ "name": "encoder.layer.2.intermediate.dense.bias",
806
+ "shape": [
807
+ 1536
808
+ ],
809
+ "kind": "replacement"
810
+ },
811
+ {
812
+ "key": "t078",
813
+ "name": "encoder.layer.2.intermediate.dense.weight",
814
+ "shape": [
815
+ 1536,
816
+ 384
817
+ ],
818
+ "kind": "factor",
819
+ "rank": 71,
820
+ "matrix_shape": [
821
+ 1536,
822
+ 384
823
+ ]
824
+ },
825
+ {
826
+ "key": "t079",
827
+ "name": "encoder.layer.2.layernorm_after.bias",
828
+ "shape": [
829
+ 384
830
+ ],
831
+ "kind": "replacement"
832
+ },
833
+ {
834
+ "key": "t080",
835
+ "name": "encoder.layer.2.layernorm_after.weight",
836
+ "shape": [
837
+ 384
838
+ ],
839
+ "kind": "replacement"
840
+ },
841
+ {
842
+ "key": "t081",
843
+ "name": "encoder.layer.2.layernorm_before.bias",
844
+ "shape": [
845
+ 384
846
+ ],
847
+ "kind": "replacement"
848
+ },
849
+ {
850
+ "key": "t082",
851
+ "name": "encoder.layer.2.layernorm_before.weight",
852
+ "shape": [
853
+ 384
854
+ ],
855
+ "kind": "replacement"
856
+ },
857
+ {
858
+ "key": "t083",
859
+ "name": "encoder.layer.2.output.dense.bias",
860
+ "shape": [
861
+ 384
862
+ ],
863
+ "kind": "replacement"
864
+ },
865
+ {
866
+ "key": "t084",
867
+ "name": "encoder.layer.2.output.dense.weight",
868
+ "shape": [
869
+ 384,
870
+ 1536
871
+ ],
872
+ "kind": "factor",
873
+ "rank": 71,
874
+ "matrix_shape": [
875
+ 384,
876
+ 1536
877
+ ]
878
+ },
879
+ {
880
+ "key": "t085",
881
+ "name": "encoder.layer.3.attention.attention.key.bias",
882
+ "shape": [
883
+ 384
884
+ ],
885
+ "kind": "replacement"
886
+ },
887
+ {
888
+ "key": "t086",
889
+ "name": "encoder.layer.3.attention.attention.key.weight",
890
+ "shape": [
891
+ 384,
892
+ 384
893
+ ],
894
+ "kind": "factor",
895
+ "rank": 71,
896
+ "matrix_shape": [
897
+ 384,
898
+ 384
899
+ ]
900
+ },
901
+ {
902
+ "key": "t087",
903
+ "name": "encoder.layer.3.attention.attention.query.bias",
904
+ "shape": [
905
+ 384
906
+ ],
907
+ "kind": "replacement"
908
+ },
909
+ {
910
+ "key": "t088",
911
+ "name": "encoder.layer.3.attention.attention.query.weight",
912
+ "shape": [
913
+ 384,
914
+ 384
915
+ ],
916
+ "kind": "factor",
917
+ "rank": 71,
918
+ "matrix_shape": [
919
+ 384,
920
+ 384
921
+ ]
922
+ },
923
+ {
924
+ "key": "t089",
925
+ "name": "encoder.layer.3.attention.attention.value.bias",
926
+ "shape": [
927
+ 384
928
+ ],
929
+ "kind": "replacement"
930
+ },
931
+ {
932
+ "key": "t090",
933
+ "name": "encoder.layer.3.attention.attention.value.weight",
934
+ "shape": [
935
+ 384,
936
+ 384
937
+ ],
938
+ "kind": "factor",
939
+ "rank": 71,
940
+ "matrix_shape": [
941
+ 384,
942
+ 384
943
+ ]
944
+ },
945
+ {
946
+ "key": "t091",
947
+ "name": "encoder.layer.3.attention.output.dense.bias",
948
+ "shape": [
949
+ 384
950
+ ],
951
+ "kind": "replacement"
952
+ },
953
+ {
954
+ "key": "t092",
955
+ "name": "encoder.layer.3.attention.output.dense.weight",
956
+ "shape": [
957
+ 384,
958
+ 384
959
+ ],
960
+ "kind": "factor",
961
+ "rank": 71,
962
+ "matrix_shape": [
963
+ 384,
964
+ 384
965
+ ]
966
+ },
967
+ {
968
+ "key": "t093",
969
+ "name": "encoder.layer.3.intermediate.dense.bias",
970
+ "shape": [
971
+ 1536
972
+ ],
973
+ "kind": "replacement"
974
+ },
975
+ {
976
+ "key": "t094",
977
+ "name": "encoder.layer.3.intermediate.dense.weight",
978
+ "shape": [
979
+ 1536,
980
+ 384
981
+ ],
982
+ "kind": "factor",
983
+ "rank": 71,
984
+ "matrix_shape": [
985
+ 1536,
986
+ 384
987
+ ]
988
+ },
989
+ {
990
+ "key": "t095",
991
+ "name": "encoder.layer.3.layernorm_after.bias",
992
+ "shape": [
993
+ 384
994
+ ],
995
+ "kind": "replacement"
996
+ },
997
+ {
998
+ "key": "t096",
999
+ "name": "encoder.layer.3.layernorm_after.weight",
1000
+ "shape": [
1001
+ 384
1002
+ ],
1003
+ "kind": "replacement"
1004
+ },
1005
+ {
1006
+ "key": "t097",
1007
+ "name": "encoder.layer.3.layernorm_before.bias",
1008
+ "shape": [
1009
+ 384
1010
+ ],
1011
+ "kind": "replacement"
1012
+ },
1013
+ {
1014
+ "key": "t098",
1015
+ "name": "encoder.layer.3.layernorm_before.weight",
1016
+ "shape": [
1017
+ 384
1018
+ ],
1019
+ "kind": "replacement"
1020
+ },
1021
+ {
1022
+ "key": "t099",
1023
+ "name": "encoder.layer.3.output.dense.bias",
1024
+ "shape": [
1025
+ 384
1026
+ ],
1027
+ "kind": "replacement"
1028
+ },
1029
+ {
1030
+ "key": "t100",
1031
+ "name": "encoder.layer.3.output.dense.weight",
1032
+ "shape": [
1033
+ 384,
1034
+ 1536
1035
+ ],
1036
+ "kind": "factor",
1037
+ "rank": 71,
1038
+ "matrix_shape": [
1039
+ 384,
1040
+ 1536
1041
+ ]
1042
+ },
1043
+ {
1044
+ "key": "t101",
1045
+ "name": "encoder.layer.4.attention.attention.key.bias",
1046
+ "shape": [
1047
+ 384
1048
+ ],
1049
+ "kind": "replacement"
1050
+ },
1051
+ {
1052
+ "key": "t102",
1053
+ "name": "encoder.layer.4.attention.attention.key.weight",
1054
+ "shape": [
1055
+ 384,
1056
+ 384
1057
+ ],
1058
+ "kind": "factor",
1059
+ "rank": 71,
1060
+ "matrix_shape": [
1061
+ 384,
1062
+ 384
1063
+ ]
1064
+ },
1065
+ {
1066
+ "key": "t103",
1067
+ "name": "encoder.layer.4.attention.attention.query.bias",
1068
+ "shape": [
1069
+ 384
1070
+ ],
1071
+ "kind": "replacement"
1072
+ },
1073
+ {
1074
+ "key": "t104",
1075
+ "name": "encoder.layer.4.attention.attention.query.weight",
1076
+ "shape": [
1077
+ 384,
1078
+ 384
1079
+ ],
1080
+ "kind": "factor",
1081
+ "rank": 71,
1082
+ "matrix_shape": [
1083
+ 384,
1084
+ 384
1085
+ ]
1086
+ },
1087
+ {
1088
+ "key": "t105",
1089
+ "name": "encoder.layer.4.attention.attention.value.bias",
1090
+ "shape": [
1091
+ 384
1092
+ ],
1093
+ "kind": "replacement"
1094
+ },
1095
+ {
1096
+ "key": "t106",
1097
+ "name": "encoder.layer.4.attention.attention.value.weight",
1098
+ "shape": [
1099
+ 384,
1100
+ 384
1101
+ ],
1102
+ "kind": "factor",
1103
+ "rank": 71,
1104
+ "matrix_shape": [
1105
+ 384,
1106
+ 384
1107
+ ]
1108
+ },
1109
+ {
1110
+ "key": "t107",
1111
+ "name": "encoder.layer.4.attention.output.dense.bias",
1112
+ "shape": [
1113
+ 384
1114
+ ],
1115
+ "kind": "replacement"
1116
+ },
1117
+ {
1118
+ "key": "t108",
1119
+ "name": "encoder.layer.4.attention.output.dense.weight",
1120
+ "shape": [
1121
+ 384,
1122
+ 384
1123
+ ],
1124
+ "kind": "factor",
1125
+ "rank": 71,
1126
+ "matrix_shape": [
1127
+ 384,
1128
+ 384
1129
+ ]
1130
+ },
1131
+ {
1132
+ "key": "t109",
1133
+ "name": "encoder.layer.4.intermediate.dense.bias",
1134
+ "shape": [
1135
+ 1536
1136
+ ],
1137
+ "kind": "replacement"
1138
+ },
1139
+ {
1140
+ "key": "t110",
1141
+ "name": "encoder.layer.4.intermediate.dense.weight",
1142
+ "shape": [
1143
+ 1536,
1144
+ 384
1145
+ ],
1146
+ "kind": "factor",
1147
+ "rank": 71,
1148
+ "matrix_shape": [
1149
+ 1536,
1150
+ 384
1151
+ ]
1152
+ },
1153
+ {
1154
+ "key": "t111",
1155
+ "name": "encoder.layer.4.layernorm_after.bias",
1156
+ "shape": [
1157
+ 384
1158
+ ],
1159
+ "kind": "replacement"
1160
+ },
1161
+ {
1162
+ "key": "t112",
1163
+ "name": "encoder.layer.4.layernorm_after.weight",
1164
+ "shape": [
1165
+ 384
1166
+ ],
1167
+ "kind": "replacement"
1168
+ },
1169
+ {
1170
+ "key": "t113",
1171
+ "name": "encoder.layer.4.layernorm_before.bias",
1172
+ "shape": [
1173
+ 384
1174
+ ],
1175
+ "kind": "replacement"
1176
+ },
1177
+ {
1178
+ "key": "t114",
1179
+ "name": "encoder.layer.4.layernorm_before.weight",
1180
+ "shape": [
1181
+ 384
1182
+ ],
1183
+ "kind": "replacement"
1184
+ },
1185
+ {
1186
+ "key": "t115",
1187
+ "name": "encoder.layer.4.output.dense.bias",
1188
+ "shape": [
1189
+ 384
1190
+ ],
1191
+ "kind": "replacement"
1192
+ },
1193
+ {
1194
+ "key": "t116",
1195
+ "name": "encoder.layer.4.output.dense.weight",
1196
+ "shape": [
1197
+ 384,
1198
+ 1536
1199
+ ],
1200
+ "kind": "factor",
1201
+ "rank": 71,
1202
+ "matrix_shape": [
1203
+ 384,
1204
+ 1536
1205
+ ]
1206
+ },
1207
+ {
1208
+ "key": "t117",
1209
+ "name": "encoder.layer.5.attention.attention.key.bias",
1210
+ "shape": [
1211
+ 384
1212
+ ],
1213
+ "kind": "replacement"
1214
+ },
1215
+ {
1216
+ "key": "t118",
1217
+ "name": "encoder.layer.5.attention.attention.key.weight",
1218
+ "shape": [
1219
+ 384,
1220
+ 384
1221
+ ],
1222
+ "kind": "factor",
1223
+ "rank": 71,
1224
+ "matrix_shape": [
1225
+ 384,
1226
+ 384
1227
+ ]
1228
+ },
1229
+ {
1230
+ "key": "t119",
1231
+ "name": "encoder.layer.5.attention.attention.query.bias",
1232
+ "shape": [
1233
+ 384
1234
+ ],
1235
+ "kind": "replacement"
1236
+ },
1237
+ {
1238
+ "key": "t120",
1239
+ "name": "encoder.layer.5.attention.attention.query.weight",
1240
+ "shape": [
1241
+ 384,
1242
+ 384
1243
+ ],
1244
+ "kind": "factor",
1245
+ "rank": 71,
1246
+ "matrix_shape": [
1247
+ 384,
1248
+ 384
1249
+ ]
1250
+ },
1251
+ {
1252
+ "key": "t121",
1253
+ "name": "encoder.layer.5.attention.attention.value.bias",
1254
+ "shape": [
1255
+ 384
1256
+ ],
1257
+ "kind": "replacement"
1258
+ },
1259
+ {
1260
+ "key": "t122",
1261
+ "name": "encoder.layer.5.attention.attention.value.weight",
1262
+ "shape": [
1263
+ 384,
1264
+ 384
1265
+ ],
1266
+ "kind": "factor",
1267
+ "rank": 71,
1268
+ "matrix_shape": [
1269
+ 384,
1270
+ 384
1271
+ ]
1272
+ },
1273
+ {
1274
+ "key": "t123",
1275
+ "name": "encoder.layer.5.attention.output.dense.bias",
1276
+ "shape": [
1277
+ 384
1278
+ ],
1279
+ "kind": "replacement"
1280
+ },
1281
+ {
1282
+ "key": "t124",
1283
+ "name": "encoder.layer.5.attention.output.dense.weight",
1284
+ "shape": [
1285
+ 384,
1286
+ 384
1287
+ ],
1288
+ "kind": "factor",
1289
+ "rank": 71,
1290
+ "matrix_shape": [
1291
+ 384,
1292
+ 384
1293
+ ]
1294
+ },
1295
+ {
1296
+ "key": "t125",
1297
+ "name": "encoder.layer.5.intermediate.dense.bias",
1298
+ "shape": [
1299
+ 1536
1300
+ ],
1301
+ "kind": "replacement"
1302
+ },
1303
+ {
1304
+ "key": "t126",
1305
+ "name": "encoder.layer.5.intermediate.dense.weight",
1306
+ "shape": [
1307
+ 1536,
1308
+ 384
1309
+ ],
1310
+ "kind": "factor",
1311
+ "rank": 71,
1312
+ "matrix_shape": [
1313
+ 1536,
1314
+ 384
1315
+ ]
1316
+ },
1317
+ {
1318
+ "key": "t127",
1319
+ "name": "encoder.layer.5.layernorm_after.bias",
1320
+ "shape": [
1321
+ 384
1322
+ ],
1323
+ "kind": "replacement"
1324
+ },
1325
+ {
1326
+ "key": "t128",
1327
+ "name": "encoder.layer.5.layernorm_after.weight",
1328
+ "shape": [
1329
+ 384
1330
+ ],
1331
+ "kind": "replacement"
1332
+ },
1333
+ {
1334
+ "key": "t129",
1335
+ "name": "encoder.layer.5.layernorm_before.bias",
1336
+ "shape": [
1337
+ 384
1338
+ ],
1339
+ "kind": "replacement"
1340
+ },
1341
+ {
1342
+ "key": "t130",
1343
+ "name": "encoder.layer.5.layernorm_before.weight",
1344
+ "shape": [
1345
+ 384
1346
+ ],
1347
+ "kind": "replacement"
1348
+ },
1349
+ {
1350
+ "key": "t131",
1351
+ "name": "encoder.layer.5.output.dense.bias",
1352
+ "shape": [
1353
+ 384
1354
+ ],
1355
+ "kind": "replacement"
1356
+ },
1357
+ {
1358
+ "key": "t132",
1359
+ "name": "encoder.layer.5.output.dense.weight",
1360
+ "shape": [
1361
+ 384,
1362
+ 1536
1363
+ ],
1364
+ "kind": "factor",
1365
+ "rank": 71,
1366
+ "matrix_shape": [
1367
+ 384,
1368
+ 1536
1369
+ ]
1370
+ },
1371
+ {
1372
+ "key": "t133",
1373
+ "name": "encoder.layer.6.attention.attention.key.bias",
1374
+ "shape": [
1375
+ 384
1376
+ ],
1377
+ "kind": "replacement"
1378
+ },
1379
+ {
1380
+ "key": "t134",
1381
+ "name": "encoder.layer.6.attention.attention.key.weight",
1382
+ "shape": [
1383
+ 384,
1384
+ 384
1385
+ ],
1386
+ "kind": "factor",
1387
+ "rank": 71,
1388
+ "matrix_shape": [
1389
+ 384,
1390
+ 384
1391
+ ]
1392
+ },
1393
+ {
1394
+ "key": "t135",
1395
+ "name": "encoder.layer.6.attention.attention.query.bias",
1396
+ "shape": [
1397
+ 384
1398
+ ],
1399
+ "kind": "replacement"
1400
+ },
1401
+ {
1402
+ "key": "t136",
1403
+ "name": "encoder.layer.6.attention.attention.query.weight",
1404
+ "shape": [
1405
+ 384,
1406
+ 384
1407
+ ],
1408
+ "kind": "factor",
1409
+ "rank": 71,
1410
+ "matrix_shape": [
1411
+ 384,
1412
+ 384
1413
+ ]
1414
+ },
1415
+ {
1416
+ "key": "t137",
1417
+ "name": "encoder.layer.6.attention.attention.value.bias",
1418
+ "shape": [
1419
+ 384
1420
+ ],
1421
+ "kind": "replacement"
1422
+ },
1423
+ {
1424
+ "key": "t138",
1425
+ "name": "encoder.layer.6.attention.attention.value.weight",
1426
+ "shape": [
1427
+ 384,
1428
+ 384
1429
+ ],
1430
+ "kind": "factor",
1431
+ "rank": 71,
1432
+ "matrix_shape": [
1433
+ 384,
1434
+ 384
1435
+ ]
1436
+ },
1437
+ {
1438
+ "key": "t139",
1439
+ "name": "encoder.layer.6.attention.output.dense.bias",
1440
+ "shape": [
1441
+ 384
1442
+ ],
1443
+ "kind": "replacement"
1444
+ },
1445
+ {
1446
+ "key": "t140",
1447
+ "name": "encoder.layer.6.attention.output.dense.weight",
1448
+ "shape": [
1449
+ 384,
1450
+ 384
1451
+ ],
1452
+ "kind": "factor",
1453
+ "rank": 71,
1454
+ "matrix_shape": [
1455
+ 384,
1456
+ 384
1457
+ ]
1458
+ },
1459
+ {
1460
+ "key": "t141",
1461
+ "name": "encoder.layer.6.intermediate.dense.bias",
1462
+ "shape": [
1463
+ 1536
1464
+ ],
1465
+ "kind": "replacement"
1466
+ },
1467
+ {
1468
+ "key": "t142",
1469
+ "name": "encoder.layer.6.intermediate.dense.weight",
1470
+ "shape": [
1471
+ 1536,
1472
+ 384
1473
+ ],
1474
+ "kind": "factor",
1475
+ "rank": 71,
1476
+ "matrix_shape": [
1477
+ 1536,
1478
+ 384
1479
+ ]
1480
+ },
1481
+ {
1482
+ "key": "t143",
1483
+ "name": "encoder.layer.6.layernorm_after.bias",
1484
+ "shape": [
1485
+ 384
1486
+ ],
1487
+ "kind": "replacement"
1488
+ },
1489
+ {
1490
+ "key": "t144",
1491
+ "name": "encoder.layer.6.layernorm_after.weight",
1492
+ "shape": [
1493
+ 384
1494
+ ],
1495
+ "kind": "replacement"
1496
+ },
1497
+ {
1498
+ "key": "t145",
1499
+ "name": "encoder.layer.6.layernorm_before.bias",
1500
+ "shape": [
1501
+ 384
1502
+ ],
1503
+ "kind": "replacement"
1504
+ },
1505
+ {
1506
+ "key": "t146",
1507
+ "name": "encoder.layer.6.layernorm_before.weight",
1508
+ "shape": [
1509
+ 384
1510
+ ],
1511
+ "kind": "replacement"
1512
+ },
1513
+ {
1514
+ "key": "t147",
1515
+ "name": "encoder.layer.6.output.dense.bias",
1516
+ "shape": [
1517
+ 384
1518
+ ],
1519
+ "kind": "replacement"
1520
+ },
1521
+ {
1522
+ "key": "t148",
1523
+ "name": "encoder.layer.6.output.dense.weight",
1524
+ "shape": [
1525
+ 384,
1526
+ 1536
1527
+ ],
1528
+ "kind": "factor",
1529
+ "rank": 71,
1530
+ "matrix_shape": [
1531
+ 384,
1532
+ 1536
1533
+ ]
1534
+ },
1535
+ {
1536
+ "key": "t149",
1537
+ "name": "encoder.layer.7.attention.attention.key.bias",
1538
+ "shape": [
1539
+ 384
1540
+ ],
1541
+ "kind": "replacement"
1542
+ },
1543
+ {
1544
+ "key": "t150",
1545
+ "name": "encoder.layer.7.attention.attention.key.weight",
1546
+ "shape": [
1547
+ 384,
1548
+ 384
1549
+ ],
1550
+ "kind": "factor",
1551
+ "rank": 71,
1552
+ "matrix_shape": [
1553
+ 384,
1554
+ 384
1555
+ ]
1556
+ },
1557
+ {
1558
+ "key": "t151",
1559
+ "name": "encoder.layer.7.attention.attention.query.bias",
1560
+ "shape": [
1561
+ 384
1562
+ ],
1563
+ "kind": "replacement"
1564
+ },
1565
+ {
1566
+ "key": "t152",
1567
+ "name": "encoder.layer.7.attention.attention.query.weight",
1568
+ "shape": [
1569
+ 384,
1570
+ 384
1571
+ ],
1572
+ "kind": "factor",
1573
+ "rank": 71,
1574
+ "matrix_shape": [
1575
+ 384,
1576
+ 384
1577
+ ]
1578
+ },
1579
+ {
1580
+ "key": "t153",
1581
+ "name": "encoder.layer.7.attention.attention.value.bias",
1582
+ "shape": [
1583
+ 384
1584
+ ],
1585
+ "kind": "replacement"
1586
+ },
1587
+ {
1588
+ "key": "t154",
1589
+ "name": "encoder.layer.7.attention.attention.value.weight",
1590
+ "shape": [
1591
+ 384,
1592
+ 384
1593
+ ],
1594
+ "kind": "factor",
1595
+ "rank": 71,
1596
+ "matrix_shape": [
1597
+ 384,
1598
+ 384
1599
+ ]
1600
+ },
1601
+ {
1602
+ "key": "t155",
1603
+ "name": "encoder.layer.7.attention.output.dense.bias",
1604
+ "shape": [
1605
+ 384
1606
+ ],
1607
+ "kind": "replacement"
1608
+ },
1609
+ {
1610
+ "key": "t156",
1611
+ "name": "encoder.layer.7.attention.output.dense.weight",
1612
+ "shape": [
1613
+ 384,
1614
+ 384
1615
+ ],
1616
+ "kind": "factor",
1617
+ "rank": 71,
1618
+ "matrix_shape": [
1619
+ 384,
1620
+ 384
1621
+ ]
1622
+ },
1623
+ {
1624
+ "key": "t157",
1625
+ "name": "encoder.layer.7.intermediate.dense.bias",
1626
+ "shape": [
1627
+ 1536
1628
+ ],
1629
+ "kind": "replacement"
1630
+ },
1631
+ {
1632
+ "key": "t158",
1633
+ "name": "encoder.layer.7.intermediate.dense.weight",
1634
+ "shape": [
1635
+ 1536,
1636
+ 384
1637
+ ],
1638
+ "kind": "factor",
1639
+ "rank": 71,
1640
+ "matrix_shape": [
1641
+ 1536,
1642
+ 384
1643
+ ]
1644
+ },
1645
+ {
1646
+ "key": "t159",
1647
+ "name": "encoder.layer.7.layernorm_after.bias",
1648
+ "shape": [
1649
+ 384
1650
+ ],
1651
+ "kind": "replacement"
1652
+ },
1653
+ {
1654
+ "key": "t160",
1655
+ "name": "encoder.layer.7.layernorm_after.weight",
1656
+ "shape": [
1657
+ 384
1658
+ ],
1659
+ "kind": "replacement"
1660
+ },
1661
+ {
1662
+ "key": "t161",
1663
+ "name": "encoder.layer.7.layernorm_before.bias",
1664
+ "shape": [
1665
+ 384
1666
+ ],
1667
+ "kind": "replacement"
1668
+ },
1669
+ {
1670
+ "key": "t162",
1671
+ "name": "encoder.layer.7.layernorm_before.weight",
1672
+ "shape": [
1673
+ 384
1674
+ ],
1675
+ "kind": "replacement"
1676
+ },
1677
+ {
1678
+ "key": "t163",
1679
+ "name": "encoder.layer.7.output.dense.bias",
1680
+ "shape": [
1681
+ 384
1682
+ ],
1683
+ "kind": "replacement"
1684
+ },
1685
+ {
1686
+ "key": "t164",
1687
+ "name": "encoder.layer.7.output.dense.weight",
1688
+ "shape": [
1689
+ 384,
1690
+ 1536
1691
+ ],
1692
+ "kind": "factor",
1693
+ "rank": 71,
1694
+ "matrix_shape": [
1695
+ 384,
1696
+ 1536
1697
+ ]
1698
+ },
1699
+ {
1700
+ "key": "t165",
1701
+ "name": "encoder.layer.8.attention.attention.key.bias",
1702
+ "shape": [
1703
+ 384
1704
+ ],
1705
+ "kind": "replacement"
1706
+ },
1707
+ {
1708
+ "key": "t166",
1709
+ "name": "encoder.layer.8.attention.attention.key.weight",
1710
+ "shape": [
1711
+ 384,
1712
+ 384
1713
+ ],
1714
+ "kind": "factor",
1715
+ "rank": 71,
1716
+ "matrix_shape": [
1717
+ 384,
1718
+ 384
1719
+ ]
1720
+ },
1721
+ {
1722
+ "key": "t167",
1723
+ "name": "encoder.layer.8.attention.attention.query.bias",
1724
+ "shape": [
1725
+ 384
1726
+ ],
1727
+ "kind": "replacement"
1728
+ },
1729
+ {
1730
+ "key": "t168",
1731
+ "name": "encoder.layer.8.attention.attention.query.weight",
1732
+ "shape": [
1733
+ 384,
1734
+ 384
1735
+ ],
1736
+ "kind": "factor",
1737
+ "rank": 71,
1738
+ "matrix_shape": [
1739
+ 384,
1740
+ 384
1741
+ ]
1742
+ },
1743
+ {
1744
+ "key": "t169",
1745
+ "name": "encoder.layer.8.attention.attention.value.bias",
1746
+ "shape": [
1747
+ 384
1748
+ ],
1749
+ "kind": "replacement"
1750
+ },
1751
+ {
1752
+ "key": "t170",
1753
+ "name": "encoder.layer.8.attention.attention.value.weight",
1754
+ "shape": [
1755
+ 384,
1756
+ 384
1757
+ ],
1758
+ "kind": "factor",
1759
+ "rank": 71,
1760
+ "matrix_shape": [
1761
+ 384,
1762
+ 384
1763
+ ]
1764
+ },
1765
+ {
1766
+ "key": "t171",
1767
+ "name": "encoder.layer.8.attention.output.dense.bias",
1768
+ "shape": [
1769
+ 384
1770
+ ],
1771
+ "kind": "replacement"
1772
+ },
1773
+ {
1774
+ "key": "t172",
1775
+ "name": "encoder.layer.8.attention.output.dense.weight",
1776
+ "shape": [
1777
+ 384,
1778
+ 384
1779
+ ],
1780
+ "kind": "factor",
1781
+ "rank": 71,
1782
+ "matrix_shape": [
1783
+ 384,
1784
+ 384
1785
+ ]
1786
+ },
1787
+ {
1788
+ "key": "t173",
1789
+ "name": "encoder.layer.8.intermediate.dense.bias",
1790
+ "shape": [
1791
+ 1536
1792
+ ],
1793
+ "kind": "replacement"
1794
+ },
1795
+ {
1796
+ "key": "t174",
1797
+ "name": "encoder.layer.8.intermediate.dense.weight",
1798
+ "shape": [
1799
+ 1536,
1800
+ 384
1801
+ ],
1802
+ "kind": "factor",
1803
+ "rank": 71,
1804
+ "matrix_shape": [
1805
+ 1536,
1806
+ 384
1807
+ ]
1808
+ },
1809
+ {
1810
+ "key": "t175",
1811
+ "name": "encoder.layer.8.layernorm_after.bias",
1812
+ "shape": [
1813
+ 384
1814
+ ],
1815
+ "kind": "replacement"
1816
+ },
1817
+ {
1818
+ "key": "t176",
1819
+ "name": "encoder.layer.8.layernorm_after.weight",
1820
+ "shape": [
1821
+ 384
1822
+ ],
1823
+ "kind": "replacement"
1824
+ },
1825
+ {
1826
+ "key": "t177",
1827
+ "name": "encoder.layer.8.layernorm_before.bias",
1828
+ "shape": [
1829
+ 384
1830
+ ],
1831
+ "kind": "replacement"
1832
+ },
1833
+ {
1834
+ "key": "t178",
1835
+ "name": "encoder.layer.8.layernorm_before.weight",
1836
+ "shape": [
1837
+ 384
1838
+ ],
1839
+ "kind": "replacement"
1840
+ },
1841
+ {
1842
+ "key": "t179",
1843
+ "name": "encoder.layer.8.output.dense.bias",
1844
+ "shape": [
1845
+ 384
1846
+ ],
1847
+ "kind": "replacement"
1848
+ },
1849
+ {
1850
+ "key": "t180",
1851
+ "name": "encoder.layer.8.output.dense.weight",
1852
+ "shape": [
1853
+ 384,
1854
+ 1536
1855
+ ],
1856
+ "kind": "factor",
1857
+ "rank": 71,
1858
+ "matrix_shape": [
1859
+ 384,
1860
+ 1536
1861
+ ]
1862
+ },
1863
+ {
1864
+ "key": "t181",
1865
+ "name": "encoder.layer.9.attention.attention.key.bias",
1866
+ "shape": [
1867
+ 384
1868
+ ],
1869
+ "kind": "replacement"
1870
+ },
1871
+ {
1872
+ "key": "t182",
1873
+ "name": "encoder.layer.9.attention.attention.key.weight",
1874
+ "shape": [
1875
+ 384,
1876
+ 384
1877
+ ],
1878
+ "kind": "factor",
1879
+ "rank": 71,
1880
+ "matrix_shape": [
1881
+ 384,
1882
+ 384
1883
+ ]
1884
+ },
1885
+ {
1886
+ "key": "t183",
1887
+ "name": "encoder.layer.9.attention.attention.query.bias",
1888
+ "shape": [
1889
+ 384
1890
+ ],
1891
+ "kind": "replacement"
1892
+ },
1893
+ {
1894
+ "key": "t184",
1895
+ "name": "encoder.layer.9.attention.attention.query.weight",
1896
+ "shape": [
1897
+ 384,
1898
+ 384
1899
+ ],
1900
+ "kind": "factor",
1901
+ "rank": 71,
1902
+ "matrix_shape": [
1903
+ 384,
1904
+ 384
1905
+ ]
1906
+ },
1907
+ {
1908
+ "key": "t185",
1909
+ "name": "encoder.layer.9.attention.attention.value.bias",
1910
+ "shape": [
1911
+ 384
1912
+ ],
1913
+ "kind": "replacement"
1914
+ },
1915
+ {
1916
+ "key": "t186",
1917
+ "name": "encoder.layer.9.attention.attention.value.weight",
1918
+ "shape": [
1919
+ 384,
1920
+ 384
1921
+ ],
1922
+ "kind": "factor",
1923
+ "rank": 71,
1924
+ "matrix_shape": [
1925
+ 384,
1926
+ 384
1927
+ ]
1928
+ },
1929
+ {
1930
+ "key": "t187",
1931
+ "name": "encoder.layer.9.attention.output.dense.bias",
1932
+ "shape": [
1933
+ 384
1934
+ ],
1935
+ "kind": "replacement"
1936
+ },
1937
+ {
1938
+ "key": "t188",
1939
+ "name": "encoder.layer.9.attention.output.dense.weight",
1940
+ "shape": [
1941
+ 384,
1942
+ 384
1943
+ ],
1944
+ "kind": "factor",
1945
+ "rank": 71,
1946
+ "matrix_shape": [
1947
+ 384,
1948
+ 384
1949
+ ]
1950
+ },
1951
+ {
1952
+ "key": "t189",
1953
+ "name": "encoder.layer.9.intermediate.dense.bias",
1954
+ "shape": [
1955
+ 1536
1956
+ ],
1957
+ "kind": "replacement"
1958
+ },
1959
+ {
1960
+ "key": "t190",
1961
+ "name": "encoder.layer.9.intermediate.dense.weight",
1962
+ "shape": [
1963
+ 1536,
1964
+ 384
1965
+ ],
1966
+ "kind": "factor",
1967
+ "rank": 71,
1968
+ "matrix_shape": [
1969
+ 1536,
1970
+ 384
1971
+ ]
1972
+ },
1973
+ {
1974
+ "key": "t191",
1975
+ "name": "encoder.layer.9.layernorm_after.bias",
1976
+ "shape": [
1977
+ 384
1978
+ ],
1979
+ "kind": "replacement"
1980
+ },
1981
+ {
1982
+ "key": "t192",
1983
+ "name": "encoder.layer.9.layernorm_after.weight",
1984
+ "shape": [
1985
+ 384
1986
+ ],
1987
+ "kind": "replacement"
1988
+ },
1989
+ {
1990
+ "key": "t193",
1991
+ "name": "encoder.layer.9.layernorm_before.bias",
1992
+ "shape": [
1993
+ 384
1994
+ ],
1995
+ "kind": "replacement"
1996
+ },
1997
+ {
1998
+ "key": "t194",
1999
+ "name": "encoder.layer.9.layernorm_before.weight",
2000
+ "shape": [
2001
+ 384
2002
+ ],
2003
+ "kind": "replacement"
2004
+ },
2005
+ {
2006
+ "key": "t195",
2007
+ "name": "encoder.layer.9.output.dense.bias",
2008
+ "shape": [
2009
+ 384
2010
+ ],
2011
+ "kind": "replacement"
2012
+ },
2013
+ {
2014
+ "key": "t196",
2015
+ "name": "encoder.layer.9.output.dense.weight",
2016
+ "shape": [
2017
+ 384,
2018
+ 1536
2019
+ ],
2020
+ "kind": "factor",
2021
+ "rank": 71,
2022
+ "matrix_shape": [
2023
+ 384,
2024
+ 1536
2025
+ ]
2026
+ },
2027
+ {
2028
+ "key": "t197",
2029
+ "name": "layernorm.bias",
2030
+ "shape": [
2031
+ 384
2032
+ ],
2033
+ "kind": "replacement"
2034
+ },
2035
+ {
2036
+ "key": "t198",
2037
+ "name": "layernorm.weight",
2038
+ "shape": [
2039
+ 384
2040
+ ],
2041
+ "kind": "replacement"
2042
+ }
2043
+ ],
2044
+ "files_sha256": {
2045
+ "weights.safetensors": "9b58d252978d3a5d33adcdaea95e113162daf5146e20a9e1b8aa47e21e48ed93",
2046
+ "english-assets/README.md": "7e0f183a2697956065aea4e3ec9ca718967be1b7afe446cff4dcdbc8a64fa52b",
2047
+ "english-assets/config.json": "2b6e06edec319984eca99c932d940bfa1f308db3f74d6279440b906c373bf727",
2048
+ "english-assets/generation_config.json": "41149cdcffec4d657f32dfcddd9b208037f01286c9e07945c724908c58ed0193",
2049
+ "english-assets/preprocessor_config.json": "eec0c686d2e2ea6d5887f87e1c6a34ef5bf1ba5b2ac98b8675e131da646fa1d2",
2050
+ "english-assets/sentencepiece.bpe.model": "6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4",
2051
+ "english-assets/special_tokens_map.json": "58dc0a3d15e3bad4861bcf2dee770ea327344d185182d4c5d2bf253285e53a83",
2052
+ "english-assets/tokenizer_config.json": "e098c98c6834fbcd3f3e75215e3e8b8868f0fe5bf07aef93d28e4f7196db293c",
2053
+ "character-assets/config.json": "decbe7681cc6000bd5bf83226b295e7a051e8280bc12255961e011d2caadbfce",
2054
+ "character-assets/generation_config.json": "9577d3da76b60ee97a70d1516ac144eba329a8a70dd0e96c6f721c910434dcff",
2055
+ "character-assets/character_codec.json": "7bb65c86bc29b555f8da3af81b7023e370bdebe6ced8c84d104d55165c6ffb0a",
2056
+ "character-assets/preprocessor_config.json": "36a945a7cc645688b9ef64dabae16979cf5f7c1c448569cc306694edc0598b9b",
2057
+ "model-configs.json": "1c598da84fcbe26af738d5ef1c0ea04f80f965e7690b1089aeaa8c7977cd4359",
2058
+ "english-generation.json": "cddf3683b66672c43fee2a6d966829eebf2a00c61d376d0eb30db972693210be",
2059
+ "character-generation.json": "02b8abbca9b3f1e5fb8ea2057b0aea84e1f488dd5dd2ca52a75850170bc3b08b"
2060
+ },
2061
+ "uniform_rank": 71,
2062
+ "routing_parameters_reserved": 100000,
2063
+ "automatic_dispatch": false,
2064
+ "scope": "Serial CPU source candidate only; no accuracy or native Paddle qualification",
2065
+ "original_model_sha256": "1b83102cbc1520dee1c3937ac334da83da18cf4683d46ebd1bd4e93ebe584dd7",
2066
+ "parent_bundle_sha256": "b9281e7da68d2b9c331697a9fb15da3a2366fb937fce00742d658987d924318e",
2067
+ "training_run_sha256": "713dfd450e19d12523585d9973aad7a7236097e64206e035800bbdcfeacb21e3",
2068
+ "training_step": 8000,
2069
+ "training_chain": "5e79546a138135b739b6485f3af4d81d412baa44119e849ec307ac8d87dff4ec",
2070
+ "initial_character_model_sha256": "fcc1346b8c6aa36ae04b8628deb5cd309aa09d4574f0ed9ee0ce4d124091174a",
2071
+ "root_bundle_sha256": "a52a68c8950c7eada39215d52b7b1eaf893d23577297951019bce382689baf48",
2072
+ "parent_training_step": 8000,
2073
+ "cumulative_training_step": 16000,
2074
+ "parent_training_run_sha256": "f33da3168d15a743a4e73a59a77a55f5c85e41ee675cf006a00c940b9a23c70b"
2075
+ }
paddle/candidate/character-assets/character_codec.json ADDED
@@ -0,0 +1,590 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "kind": "literal_NFC_characters",
4
+ "classes": 573,
5
+ "special_ids": {
6
+ "BOS_serialization": 0,
7
+ "PAD": 1,
8
+ "EOS_and_decoder_start": 2,
9
+ "UNK": 3
10
+ },
11
+ "character_ids": {
12
+ "!": 4,
13
+ "\"": 5,
14
+ "#": 6,
15
+ "$": 7,
16
+ "%": 8,
17
+ "&": 9,
18
+ "'": 10,
19
+ "(": 11,
20
+ ")": 12,
21
+ "*": 13,
22
+ "+": 14,
23
+ ",": 15,
24
+ "-": 16,
25
+ ".": 17,
26
+ "/": 18,
27
+ "0": 19,
28
+ "1": 20,
29
+ "2": 21,
30
+ "3": 22,
31
+ "4": 23,
32
+ "5": 24,
33
+ "6": 25,
34
+ "7": 26,
35
+ "8": 27,
36
+ "9": 28,
37
+ ":": 29,
38
+ ";": 30,
39
+ "<": 31,
40
+ "=": 32,
41
+ ">": 33,
42
+ "?": 34,
43
+ "A": 35,
44
+ "B": 36,
45
+ "C": 37,
46
+ "D": 38,
47
+ "E": 39,
48
+ "F": 40,
49
+ "G": 41,
50
+ "H": 42,
51
+ "I": 43,
52
+ "J": 44,
53
+ "K": 45,
54
+ "L": 46,
55
+ "M": 47,
56
+ "N": 48,
57
+ "O": 49,
58
+ "P": 50,
59
+ "Q": 51,
60
+ "R": 52,
61
+ "S": 53,
62
+ "T": 54,
63
+ "U": 55,
64
+ "V": 56,
65
+ "W": 57,
66
+ "X": 58,
67
+ "Y": 59,
68
+ "Z": 60,
69
+ "[": 61,
70
+ "]": 62,
71
+ "_": 63,
72
+ "`": 64,
73
+ "a": 65,
74
+ "b": 66,
75
+ "c": 67,
76
+ "d": 68,
77
+ "e": 69,
78
+ "f": 70,
79
+ "g": 71,
80
+ "h": 72,
81
+ "i": 73,
82
+ "j": 74,
83
+ "k": 75,
84
+ "l": 76,
85
+ "m": 77,
86
+ "n": 78,
87
+ "o": 79,
88
+ "p": 80,
89
+ "q": 81,
90
+ "r": 82,
91
+ "s": 83,
92
+ "t": 84,
93
+ "u": 85,
94
+ "v": 86,
95
+ "w": 87,
96
+ "x": 88,
97
+ "y": 89,
98
+ "z": 90,
99
+ "©": 91,
100
+ "‥": 92,
101
+ "{": 93,
102
+ "}": 94,
103
+ "\\": 95,
104
+ "|": 96,
105
+ "@": 97,
106
+ "^": 98,
107
+ "~": 99,
108
+ "÷": 100,
109
+ "∕": 101,
110
+ "∙": 102,
111
+ "⋅": 103,
112
+ "·": 104,
113
+ "±": 105,
114
+ "∓": 106,
115
+ "∩": 107,
116
+ "∪": 108,
117
+ "□": 109,
118
+ "←": 110,
119
+ "↔": 111,
120
+ "⇒": 112,
121
+ "⇐": 113,
122
+ "⇔": 114,
123
+ "∀": 115,
124
+ "∃": 116,
125
+ "∄": 117,
126
+ "∴": 118,
127
+ "∵": 119,
128
+ "∝": 120,
129
+ "∞": 121,
130
+ "⊥": 122,
131
+ "∟": 123,
132
+ "∠": 124,
133
+ "∡": 125,
134
+ "∢": 126,
135
+ "′": 127,
136
+ "″": 128,
137
+ "∥": 129,
138
+ "⊾": 130,
139
+ "⊿": 131,
140
+ "∂": 132,
141
+ "∫": 133,
142
+ "∬": 134,
143
+ "∭": 135,
144
+ "∮": 136,
145
+ "∯": 137,
146
+ "∰": 138,
147
+ "∑": 139,
148
+ "∏": 140,
149
+ "√": 141,
150
+ "∛": 142,
151
+ "∜": 143,
152
+ "∱": 144,
153
+ "∲": 145,
154
+ "∳": 146,
155
+ "∶": 147,
156
+ "∷": 148,
157
+ "∼": 149,
158
+ "®": 150,
159
+ "℉": 151,
160
+ "Ω": 152,
161
+ "℧": 153,
162
+ "Å": 154,
163
+ "⌀": 155,
164
+ "ℏ": 156,
165
+ "⅀": 157,
166
+ "⍺": 158,
167
+ "⍵": 159,
168
+ "¢": 160,
169
+ "€": 161,
170
+ "£": 162,
171
+ "¥": 163,
172
+ "₿": 164,
173
+ "Ⅰ": 165,
174
+ "Ⅱ": 166,
175
+ "Ⅲ": 167,
176
+ "Ⅳ": 168,
177
+ "Ⅴ": 169,
178
+ "Ⅵ": 170,
179
+ "Ⅶ": 171,
180
+ "Ⅷ": 172,
181
+ "Ⅸ": 173,
182
+ "Ⅹ": 174,
183
+ "Ⅺ": 175,
184
+ "Ⅻ": 176,
185
+ "ⅰ": 177,
186
+ "ⅱ": 178,
187
+ "ⅲ": 179,
188
+ "ⅳ": 180,
189
+ "ⅴ": 181,
190
+ "ⅵ": 182,
191
+ "ⅶ": 183,
192
+ "ⅷ": 184,
193
+ "ⅸ": 185,
194
+ "ⅹ": 186,
195
+ "ⅺ": 187,
196
+ "ⅻ": 188,
197
+ "➀": 189,
198
+ "➁": 190,
199
+ "➂": 191,
200
+ "➃": 192,
201
+ "➄": 193,
202
+ "➅": 194,
203
+ "➆": 195,
204
+ "➇": 196,
205
+ "➈": 197,
206
+ "➉": 198,
207
+ "➊": 199,
208
+ "➋": 200,
209
+ "➌": 201,
210
+ "➍": 202,
211
+ "➎": 203,
212
+ "➏": 204,
213
+ "➐": 205,
214
+ "➑": 206,
215
+ "➒": 207,
216
+ "➓": 208,
217
+ "❶": 209,
218
+ "❷": 210,
219
+ "❸": 211,
220
+ "❹": 212,
221
+ "❺": 213,
222
+ "❻": 214,
223
+ "❼": 215,
224
+ "❽": 216,
225
+ "❾": 217,
226
+ "❿": 218,
227
+ "①": 219,
228
+ "②": 220,
229
+ "③": 221,
230
+ "④": 222,
231
+ "⑤": 223,
232
+ "⑥": 224,
233
+ "⑦": 225,
234
+ "⑧": 226,
235
+ "⑨": 227,
236
+ "⑩": 228,
237
+ "●": 229,
238
+ "▶": 230,
239
+ "𝑢": 231,
240
+ "︽": 232,
241
+ "–": 233,
242
+ "﹥": 234,
243
+ "𝜓": 235,
244
+ "•": 236,
245
+ "∋": 237,
246
+ "ƒ": 238,
247
+ "⬆": 239,
248
+ "Ạ": 240,
249
+ "◀": 241,
250
+ "": 242,
251
+ "▫": 243,
252
+ "︾": 244,
253
+ "À": 245,
254
+ "Á": 246,
255
+ "Â": 247,
256
+ "Ã": 248,
257
+ "Ä": 249,
258
+ "Å": 250,
259
+ "Æ": 251,
260
+ "Ç": 252,
261
+ "È": 253,
262
+ "É": 254,
263
+ "Ê": 255,
264
+ "Ë": 256,
265
+ "Ì": 257,
266
+ "Í": 258,
267
+ "Î": 259,
268
+ "Ï": 260,
269
+ "Ð": 261,
270
+ "Ñ": 262,
271
+ "Ò": 263,
272
+ "Ó": 264,
273
+ "Ô": 265,
274
+ "Õ": 266,
275
+ "Ö": 267,
276
+ "Ø": 268,
277
+ "Ù": 269,
278
+ "Ú": 270,
279
+ "Û": 271,
280
+ "Ü": 272,
281
+ "Ý": 273,
282
+ "Þ": 274,
283
+ "à": 275,
284
+ "á": 276,
285
+ "â": 277,
286
+ "ã": 278,
287
+ "ä": 279,
288
+ "å": 280,
289
+ "æ": 281,
290
+ "ç": 282,
291
+ "è": 283,
292
+ "é": 284,
293
+ "ê": 285,
294
+ "ë": 286,
295
+ "ì": 287,
296
+ "í": 288,
297
+ "î": 289,
298
+ "ï": 290,
299
+ "ð": 291,
300
+ "ñ": 292,
301
+ "ò": 293,
302
+ "ó": 294,
303
+ "ô": 295,
304
+ "õ": 296,
305
+ "ö": 297,
306
+ "ø": 298,
307
+ "ù": 299,
308
+ "ú": 300,
309
+ "û": 301,
310
+ "ü": 302,
311
+ "ý": 303,
312
+ "þ": 304,
313
+ "ÿ": 305,
314
+ "¡": 306,
315
+ "¤": 307,
316
+ "¦": 308,
317
+ "§": 309,
318
+ "¨": 310,
319
+ "ª": 311,
320
+ "«": 312,
321
+ "¬": 313,
322
+ "¯": 314,
323
+ "°": 315,
324
+ "²": 316,
325
+ "³": 317,
326
+ "´": 318,
327
+ "µ": 319,
328
+ "¶": 320,
329
+ "¸": 321,
330
+ "¹": 322,
331
+ "º": 323,
332
+ "»": 324,
333
+ "¼": 325,
334
+ "½": 326,
335
+ "¾": 327,
336
+ "¿": 328,
337
+ "×": 329,
338
+ "‐": 330,
339
+ "‑": 331,
340
+ "‒": 332,
341
+ "—": 333,
342
+ "―": 334,
343
+ "‖": 335,
344
+ "‗": 336,
345
+ "‘": 337,
346
+ "’": 338,
347
+ "‚": 339,
348
+ "‛": 340,
349
+ "“": 341,
350
+ "”": 342,
351
+ "„": 343,
352
+ "‟": 344,
353
+ "†": 345,
354
+ "‡": 346,
355
+ "‣": 347,
356
+ "․": 348,
357
+ "…": 349,
358
+ "‧": 350,
359
+ "‰": 351,
360
+ "‴": 352,
361
+ "‵": 353,
362
+ "‶": 354,
363
+ "‷": 355,
364
+ "‸": 356,
365
+ "‹": 357,
366
+ "›": 358,
367
+ "※": 359,
368
+ "‼": 360,
369
+ "‽": 361,
370
+ "‾": 362,
371
+ "₤": 363,
372
+ "₡": 364,
373
+ "₹": 365,
374
+ "−": 366,
375
+ "∖": 367,
376
+ "∗": 368,
377
+ "≈": 369,
378
+ "≠": 370,
379
+ "≡": 371,
380
+ "≤": 372,
381
+ "≥": 373,
382
+ "⊂": 374,
383
+ "⊃": 375,
384
+ "↑": 376,
385
+ "→": 377,
386
+ "↓": 378,
387
+ "↕": 379,
388
+ "™": 380,
389
+ "Ω": 381,
390
+ "℮": 382,
391
+ "∆": 383,
392
+ "✓": 384,
393
+ "✗": 385,
394
+ "✘": 386,
395
+ "▪": 387,
396
+ "◼": 388,
397
+ "✔": 389,
398
+ "✕": 390,
399
+ "☑": 391,
400
+ "☒": 392,
401
+ "№": 393,
402
+ "₽": 394,
403
+ "₴": 395,
404
+ "Α": 396,
405
+ "α": 397,
406
+ "Β": 398,
407
+ "β": 399,
408
+ "Γ": 400,
409
+ "γ": 401,
410
+ "Δ": 402,
411
+ "δ": 403,
412
+ "Ε": 404,
413
+ "ε": 405,
414
+ "Ζ": 406,
415
+ "ζ": 407,
416
+ "Η": 408,
417
+ "η": 409,
418
+ "Θ": 410,
419
+ "θ": 411,
420
+ "Ι": 412,
421
+ "ι": 413,
422
+ "Κ": 414,
423
+ "κ": 415,
424
+ "Λ": 416,
425
+ "λ": 417,
426
+ "Μ": 418,
427
+ "μ": 419,
428
+ "Ν": 420,
429
+ "ν": 421,
430
+ "Ξ": 422,
431
+ "ξ": 423,
432
+ "Ο": 424,
433
+ "ο": 425,
434
+ "Π": 426,
435
+ "π": 427,
436
+ "Ρ": 428,
437
+ "ρ": 429,
438
+ "Σ": 430,
439
+ "σ": 431,
440
+ "ς": 432,
441
+ "Τ": 433,
442
+ "τ": 434,
443
+ "Υ": 435,
444
+ "υ": 436,
445
+ "Φ": 437,
446
+ "φ": 438,
447
+ "Χ": 439,
448
+ "χ": 440,
449
+ "Ψ": 441,
450
+ "ψ": 442,
451
+ "ω": 443,
452
+ "ऀ": 444,
453
+ "ँ": 445,
454
+ "ं": 446,
455
+ "ः": 447,
456
+ "ऄ": 448,
457
+ "अ": 449,
458
+ "आ": 450,
459
+ "इ": 451,
460
+ "ई": 452,
461
+ "उ": 453,
462
+ "ऊ": 454,
463
+ "ऋ": 455,
464
+ "ऌ": 456,
465
+ "ऍ": 457,
466
+ "ऎ": 458,
467
+ "ए": 459,
468
+ "ऐ": 460,
469
+ "ऑ": 461,
470
+ "ऒ": 462,
471
+ "ओ": 463,
472
+ "औ": 464,
473
+ "क": 465,
474
+ "ख": 466,
475
+ "ग": 467,
476
+ "घ": 468,
477
+ "ङ": 469,
478
+ "च": 470,
479
+ "छ": 471,
480
+ "ज": 472,
481
+ "झ": 473,
482
+ "ञ": 474,
483
+ "ट": 475,
484
+ "ठ": 476,
485
+ "ड": 477,
486
+ "ढ": 478,
487
+ "ण": 479,
488
+ "त": 480,
489
+ "थ": 481,
490
+ "द": 482,
491
+ "ध": 483,
492
+ "न": 484,
493
+ "ऩ": 485,
494
+ "प": 486,
495
+ "फ": 487,
496
+ "ब": 488,
497
+ "भ": 489,
498
+ "म": 490,
499
+ "य": 491,
500
+ "र": 492,
501
+ "ऱ": 493,
502
+ "ल": 494,
503
+ "ळ": 495,
504
+ "ऴ": 496,
505
+ "व": 497,
506
+ "श": 498,
507
+ "ष": 499,
508
+ "स": 500,
509
+ "ह": 501,
510
+ "ऺ": 502,
511
+ "ऻ": 503,
512
+ "़": 504,
513
+ "ऽ": 505,
514
+ "ा": 506,
515
+ "ि": 507,
516
+ "ी": 508,
517
+ "ु": 509,
518
+ "ू": 510,
519
+ "ृ": 511,
520
+ "ॄ": 512,
521
+ "ॅ": 513,
522
+ "ॆ": 514,
523
+ "े": 515,
524
+ "ै": 516,
525
+ "ॉ": 517,
526
+ "ॊ": 518,
527
+ "ो": 519,
528
+ "ौ": 520,
529
+ "्": 521,
530
+ "ॎ": 522,
531
+ "ॏ": 523,
532
+ "ॐ": 524,
533
+ "॑": 525,
534
+ "॒": 526,
535
+ "॓": 527,
536
+ "॔": 528,
537
+ "ॕ": 529,
538
+ "ॖ": 530,
539
+ "ॗ": 531,
540
+ "क़": 532,
541
+ "ख़": 533,
542
+ "ग़": 534,
543
+ "ज़": 535,
544
+ "ड़": 536,
545
+ "ढ़": 537,
546
+ "फ़": 538,
547
+ "य़": 539,
548
+ "ॠ": 540,
549
+ "ॡ": 541,
550
+ "ॢ": 542,
551
+ "ॣ": 543,
552
+ "।": 544,
553
+ "॥": 545,
554
+ "०": 546,
555
+ "१": 547,
556
+ "२": 548,
557
+ "३": 549,
558
+ "४": 550,
559
+ "५": 551,
560
+ "६": 552,
561
+ "७": 553,
562
+ "८": 554,
563
+ "९": 555,
564
+ "॰": 556,
565
+ "ॱ": 557,
566
+ "ॲ": 558,
567
+ "ॳ": 559,
568
+ "ॴ": 560,
569
+ "ॵ": 561,
570
+ "ॶ": 562,
571
+ "ॷ": 563,
572
+ "ॸ": 564,
573
+ "ॹ": 565,
574
+ "ॺ": 566,
575
+ "ॻ": 567,
576
+ "ॼ": 568,
577
+ "ॽ": 569,
578
+ "ॾ": 570,
579
+ "ॿ": 571,
580
+ " ": 572
581
+ },
582
+ "generation_suppressed_ids": [
583
+ 0,
584
+ 1,
585
+ 3
586
+ ],
587
+ "training_target": "Drop serialization BOS0 only; retain every text codepoint and EOS2",
588
+ "unknown_output": "Decode3 as U+FFFD, never silently remove it",
589
+ "scope": "Experimental codec, not recognition quality or Paddle qualification."
590
+ }
paddle/candidate/character-assets/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
+ }
paddle/candidate/english-assets/README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - trocr
4
+ - image-to-text
5
+ widget:
6
+ - src: https://fki.tic.heia-fr.ch/static/img/a01-122-02.jpg
7
+ example_title: Note 1
8
+ - src: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSoolxi9yWGAT5SLZShv8vVd0bz47UWRzQC19fDTeE8GmGv_Rn-PCF1pP1rrUx8kOjA4gg&usqp=CAU
9
+ example_title: Note 2
10
+ - src: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRNYtTuSBpZPV_nkBYPMFwVVD9asZOPgHww4epu9EqWgDmXW--sE2o8og40ZfDGo87j5w&usqp=CAU
11
+ example_title: Note 3
12
+ ---
13
+
14
+ # TrOCR (small-sized model, fine-tuned on IAM)
15
+
16
+ TrOCR model fine-tuned on the [IAM dataset](https://fki.tic.heia-fr.ch/databases/iam-handwriting-database). It was introduced in the paper [TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models](https://arxiv.org/abs/2109.10282) by Li et al. and first released in [this repository](https://github.com/microsoft/unilm/tree/master/trocr).
17
+
18
+
19
+ ## Model description
20
+
21
+ The TrOCR model is an encoder-decoder model, consisting of an image Transformer as encoder, and a text Transformer as decoder. The image encoder was initialized from the weights of DeiT, while the text decoder was initialized from the weights of UniLM.
22
+
23
+ Images are presented to the model as a sequence of fixed-size patches (resolution 16x16), which are linearly embedded. One also adds absolute position embeddings before feeding the sequence to the layers of the Transformer encoder. Next, the Transformer text decoder autoregressively generates tokens.
24
+
25
+ ## Intended uses & limitations
26
+
27
+ You can use the raw model for optical character recognition (OCR) on single text-line images. See the [model hub](https://huggingface.co/models?search=microsoft/trocr) to look for fine-tuned versions on a task that interests you.
28
+
29
+ ### How to use
30
+
31
+ Here is how to use this model in PyTorch:
32
+
33
+ ```python
34
+ from transformers import TrOCRProcessor, VisionEncoderDecoderModel
35
+ from PIL import Image
36
+ import requests
37
+
38
+ # load image from the IAM database
39
+ url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
40
+ image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
41
+
42
+ processor = TrOCRProcessor.from_pretrained('microsoft/trocr-small-handwritten')
43
+ model = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-small-handwritten')
44
+ pixel_values = processor(images=image, return_tensors="pt").pixel_values
45
+
46
+ generated_ids = model.generate(pixel_values)
47
+ generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
48
+ ```
49
+
50
+ ### BibTeX entry and citation info
51
+
52
+ ```bibtex
53
+ @misc{li2021trocr,
54
+ title={TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models},
55
+ author={Minghao Li and Tengchao Lv and Lei Cui and Yijuan Lu and Dinei Florencio and Cha Zhang and Zhoujun Li and Furu Wei},
56
+ year={2021},
57
+ eprint={2109.10282},
58
+ archivePrefix={arXiv},
59
+ primaryClass={cs.CL}
60
+ }
61
+ ```
paddle/candidate/english-assets/preprocessor_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": 224,
3
+ "do_center_crop": false,
4
+ "do_normalize": true,
5
+ "do_resize": true,
6
+ "image_processor_type": "DeiTImageProcessor",
7
+ "image_mean": [
8
+ 0.5,
9
+ 0.5,
10
+ 0.5
11
+ ],
12
+ "image_std": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "resample": 3,
18
+ "size": 384
19
+ }
paddle/candidate/english-assets/sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4
3
+ size 1356293
paddle/candidate/english-assets/tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "cls_token": "<s>", "pad_token": "<pad>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "sp_model_kwargs": {}, "tokenizer_class": "XLMRobertaTokenizer"}
paddle/code/paddlex_shared_character.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Process-local PaddleX adapter for the shared two-branch research recognizer."""
2
+ import math
3
+ from pathlib import Path
4
+
5
+ import numpy as np
6
+ from PIL import Image
7
+ from paddlex.inference.models.predictors.local_model_predictor import LocalModelPredictor
8
+ from paddlex.inference.models.text_recognition.predictor import ImageBatchSampler,TextRecResult
9
+ from paddlex.inference.models.bindings.registry import register_predictor_binding_map
10
+
11
+ from shared_character_native import SharedCharacterNative,preprocess_rgb,sha
12
+
13
+
14
+ MODEL_NAME='TrOCR_shared_character_Paddle_research_rec'
15
+
16
+
17
+ class PaddleXSharedCharacter(LocalModelPredictor):
18
+ def __init__(self,*args,research_only_allow_unqualified=False,**kwargs):
19
+ super().__init__(*args,**kwargs)
20
+ if self.model_name!=MODEL_NAME or self.device!='cpu':raise ValueError('Require the shared CPU research model')
21
+ native=self.config['Native']
22
+ if native['format']!='shared-character-paddle-research-v1' or native['parameters']!=74842752:
23
+ raise ValueError('Unexpected shared recognizer profile')
24
+ for name,digest in native['files_sha256'].items():
25
+ relative=Path(name)
26
+ if relative.is_absolute() or '..' in relative.parts or relative.as_posix()!=name:raise ValueError('Invalid bundle asset path')
27
+ if sha(self.model_dir/relative)!=digest:raise ValueError('Shared bundle asset bytes changed')
28
+ self.runtime=SharedCharacterNative(self.model_dir/'candidate',self.model_dir/'encoder',self.model_dir/'decoders',
29
+ allow_unqualified=research_only_allow_unqualified,library_path=self.model_dir/'encoder-library.so')
30
+
31
+ def _build_batch_sampler(self):return ImageBatchSampler()
32
+ def _get_result_class(self):return TextRecResult
33
+
34
+ def process(self,batch_data,branch=None,return_word_box=False):
35
+ if branch not in ['english','character']:raise ValueError('Explicit research branch is required')
36
+ if return_word_box:raise ValueError('Autoregressive word-box alignment is not implemented')
37
+ images=[];outputs=[]
38
+ for item in batch_data.instances:
39
+ if isinstance(item,(str,Path)):
40
+ with Image.open(item) as source:image=source.convert('RGB')
41
+ bgr=np.asarray(image)[:,:,::-1].copy()
42
+ elif isinstance(item,np.ndarray) and item.dtype==np.uint8 and item.ndim==3 and item.shape[2]==3:
43
+ bgr=item;image=Image.fromarray(np.ascontiguousarray(bgr[:,:,::-1]))
44
+ else:raise ValueError('Require an image path or uint8 HWC BGR array')
45
+ images.append(bgr);outputs.append(self.runtime.predict_pixels(preprocess_rgb(image),branch))
46
+ return dict(input_path=batch_data.input_paths,page_index=batch_data.page_indexes,input_img=images,
47
+ rec_text=[r['text'] for r in outputs],rec_score=[min(1.,math.exp(r['score'])) for r in outputs],
48
+ beam_score=[r['score'] for r in outputs],tokens=[r['tokens'] for r in outputs],
49
+ decoder_iterations=[r['decoder_iterations'] for r in outputs],
50
+ token_limit_reached=[r['token_limit_reached'] for r in outputs],recognizer_branch=[branch]*len(outputs),
51
+ score_kind=['Uncalibrated geometric mean of generated token probabilities']*len(outputs),vis_font=[None]*len(outputs))
52
+
53
+
54
+ def register():register_predictor_binding_map(PaddleXSharedCharacter,{'flexible':[MODEL_NAME]})
paddle/code/shared_character_native.py ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Serial CPU Paddle research runtime for the three shared recognizer graphs.
2
+
3
+ Consumes only native graph parameters, codec/tokenizer assets and the compiled
4
+ encoder operator library. No Torch weights, source logits, source caches or
5
+ forced token histories enter free generation. Explicit branch selection only.
6
+ """
7
+ import hashlib
8
+ import json
9
+ from pathlib import Path
10
+
11
+ import numpy as np
12
+ import paddle
13
+ from paddle.utils.cpp_extension import load_op_meta_info_and_register_op
14
+ import sentencepiece as spm
15
+ from PIL import Image
16
+
17
+ from trocr_character_codec import CharacterCodec
18
+ from trocr_numpy_beam import TrOCRBeamState
19
+
20
+
21
+ _LIBRARY_HASH=None
22
+
23
+
24
+ def preprocess_rgb(image):
25
+ image=image.convert('RGB').resize((384,384),resample=Image.Resampling.BICUBIC)
26
+ pixels=(np.asarray(image).astype(np.float64)*(1./255.)).astype(np.float32)
27
+ return np.ascontiguousarray(((pixels-np.float32(.5))/np.float32(.5)).transpose(2,0,1)[None])
28
+
29
+
30
+ def read(path):return json.loads(Path(path).read_text())
31
+ def sha(path):
32
+ value=hashlib.sha256()
33
+ with Path(path).open('rb') as stream:
34
+ for part in iter(lambda:stream.read(1024*1024),b''):value.update(part)
35
+ return value.hexdigest()
36
+
37
+
38
+ class SharedCharacterNative:
39
+ def __init__(self,candidate,encoder,decoders,allow_unqualified=False,library_path=None,allow_control=False):
40
+ if not allow_unqualified:raise ValueError('Source research model; full native/PaddleX acceptance is pending')
41
+ if paddle.device.get_device()!='cpu':raise ValueError('Only the validated CPU operator profile is supported')
42
+ candidate,encoder,decoders=map(Path,[candidate,encoder,decoders])
43
+ manifest=read(candidate/'bundle.json');enc=read(encoder/'report.json');enc_run=read(encoder/'run.json');dec=read(decoders/'report.json')
44
+ digest=sha(candidate/'bundle.json')
45
+ assert digest==enc_run['candidate_manifest_sha256']==dec['candidate_manifest_sha256']
46
+ if digest=='a52a68c8950c7eada39215d52b7b1eaf893d23577297951019bce382689baf48':
47
+ assert not allow_control
48
+ else:
49
+ certificate=enc_run['bundle_identity']
50
+ assert certificate==dec['bundle_identity'] and certificate['candidate_manifest_sha256']==digest
51
+ assert certificate['trained_bundle'] and certificate['control_weights']==allow_control
52
+ assert certificate['weights_sha256']==manifest['files_sha256']['weights.safetensors']
53
+ if manifest['format']=='shared-character-private-continuation-source-v1':
54
+ assert manifest['parent_bundle_sha256']=='b9281e7da68d2b9c331697a9fb15da3a2366fb937fce00742d658987d924318e'
55
+ assert manifest['root_bundle_sha256']=='a52a68c8950c7eada39215d52b7b1eaf893d23577297951019bce382689baf48'
56
+ assert manifest['parent_training_step']==8000 and manifest['cumulative_training_step']==8000+manifest['training_step']
57
+ else:
58
+ assert manifest['format']=='shared-character-private-trained-source-v1'
59
+ assert manifest['parent_bundle_sha256']=='a52a68c8950c7eada39215d52b7b1eaf893d23577297951019bce382689baf48'
60
+ assert manifest['training_step'] in ([2] if allow_control else [2000,8000])
61
+ assert sha(encoder/'report.json')==dec['encoder_report_sha256']
62
+ assert enc['encoder_numerical_pass'] and enc['saved_neural_population_byte_exact']
63
+ assert dec['total_graph_neural_values']==manifest['parameters']==74842752
64
+ for name in ['character-assets/character_codec.json','english-assets/sentencepiece.bpe.model','english-assets/tokenizer_config.json']:
65
+ assert sha(candidate/name)==manifest['files_sha256'][name]
66
+ self.codec=CharacterCodec(list(read(candidate/'character-assets/character_codec.json')['character_ids']))
67
+ assert self.codec.classes==573
68
+ token_config=read(candidate/'english-assets/tokenizer_config.json')
69
+ assert token_config['tokenizer_class']=='XLMRobertaTokenizer' and token_config.get('clean_up_tokenization_spaces',False) is False
70
+ self.pieces=spm.SentencePieceProcessor(model_file=str(candidate/'english-assets/sentencepiece.bpe.model'))
71
+ assert self.pieces.get_piece_size()==64000
72
+ library=dec['encoder_library'];resolved_library=str(library_path or library['path'])
73
+ assert sha(resolved_library)==library['sha256']
74
+ self.operator_library_path=str(Path(resolved_library).resolve())
75
+ self.graph_files=[]
76
+ global _LIBRARY_HASH
77
+ if _LIBRARY_HASH is None:
78
+ load_op_meta_info_and_register_op(resolved_library);_LIBRARY_HASH=library['sha256']
79
+ else:assert _LIBRARY_HASH==library['sha256'],'Use a fresh process for a different operator library'
80
+
81
+ def load(folder,stem,hashes,selective):
82
+ for name,value in hashes.items():assert sha(folder/name)==value
83
+ self.graph_files.extend([str((folder/(stem+suffix)).resolve()) for suffix in ['.json','.pdiparams']])
84
+ config=paddle.inference.Config(str(folder/(stem+'.json')),str(folder/(stem+'.pdiparams')))
85
+ config.disable_gpu();config.set_cpu_math_library_num_threads(2)
86
+ if selective:
87
+ config.enable_mkldnn();config.enable_custom_passes(['ocr_conv_gelu_onednn_v1'],True)
88
+ else:config.disable_mkldnn()
89
+ config.switch_ir_optim(False);config.disable_glog_info()
90
+ return paddle.inference.create_predictor(config)
91
+ self.encoder=load(encoder,'encoder',enc['graph_sha256'],True)
92
+ self.decoders={branch:load(decoders/branch,'decoder-step',record['graph_sha256'],False)
93
+ for branch,record in dec['decoders'].items()}
94
+ assert set(self.encoder.get_input_names())=={'pixels','character_branch'}
95
+ assert all(set(p.get_input_names())=={'token','self_keys','self_values','cross_keys','cross_values'} for p in self.decoders.values())
96
+
97
+ @staticmethod
98
+ def run(predictor,feeds):
99
+ assert set(predictor.get_input_names())==set(feeds)
100
+ for name,value in feeds.items():predictor.get_input_handle(name).copy_from_cpu(np.ascontiguousarray(value))
101
+ predictor.run()
102
+ return [predictor.get_output_handle(n).copy_to_cpu() for n in predictor.get_output_names()]
103
+
104
+ def encode(self,pixels,branch):
105
+ assert branch in self.decoders and pixels.dtype==np.float32 and pixels.shape==(1,3,384,384)
106
+ outputs=self.run(self.encoder,dict(pixels=pixels,character_branch=np.array([branch=='character'],np.bool_)))
107
+ assert len(outputs)==2 and all(v.shape==(6,1,8,578,32) for v in outputs)
108
+ return [np.repeat(v,10,axis=1) for v in outputs]
109
+
110
+ def step(self,branch,token,self_keys,self_values,cross_keys,cross_values):
111
+ outputs=self.run(self.decoders[branch],dict(token=token,self_keys=self_keys,self_values=self_values,
112
+ cross_keys=cross_keys,cross_values=cross_values))
113
+ assert len(outputs)==3 and outputs[0].shape==(10,64044 if branch=='english' else 573)
114
+ assert outputs[1].shape==outputs[2].shape==(6,10,8,self_keys.shape[3]+1,32)
115
+ assert all(v.dtype==np.float32 and np.isfinite(v).all() for v in outputs)
116
+ return outputs
117
+
118
+ def decode(self,tokens,branch):
119
+ if branch=='character':return self.codec.decode(tokens)
120
+ pieces=[]
121
+ for token in tokens:
122
+ if token in [0,1,2,3,64001]:continue
123
+ if not 4<=token<=64000:raise ValueError('Unassigned original output row')
124
+ pieces.append(self.pieces.id_to_piece(token-1))
125
+ return ''.join(pieces).replace('\u2581',' ').strip()
126
+
127
+ def predict_pixels(self,pixels,branch):
128
+ cross=self.encode(pixels,branch)
129
+ state=TrOCRBeamState(beams=10,max_new_tokens=256 if branch=='english' else 257,
130
+ length_penalty=1.,suppress_tokens=() if branch=='english' else (0,1,3))
131
+ keys=np.zeros((6,10,8,0,32),np.float32);values=keys.copy();token=np.full((10,1),2,np.int64)
132
+ while not state.done:
133
+ logits,next_keys,next_values=self.step(branch,token,keys,values,*cross)
134
+ parents,selected=state.advance(logits)
135
+ keys=np.ascontiguousarray(next_keys[:,parents]);values=np.ascontiguousarray(next_values[:,parents]);token=selected[:,None]
136
+ tokens,score=state.result()
137
+ return dict(tokens=tokens,text=self.decode(tokens,branch),score=score,
138
+ token_limit_reached=len(tokens)-1>=(256 if branch=='english' else 257) and tokens[-1]!=2,
139
+ decoder_iterations=state.current-1)
paddle/code/trocr_character_codec.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Literal NFC character codec for the experimental compact TrOCR decoder.
2
+
3
+ Tokenizer BOS0 is serialization only; training targets exclude it. Generation
4
+ starts with EOS2 and suppresses BOS/PAD/UNK. Unknown outputs remain visible as
5
+ replacement characters when decoded, never silently removed.
6
+ """
7
+ import unicodedata
8
+
9
+
10
+ class CharacterCodec:
11
+ def __init__(self, characters):
12
+ if len(characters) != len(set(characters)) or any(len(c) != 1 for c in characters):
13
+ raise ValueError('Require ordered, unique Unicode codepoints')
14
+ self.characters = list(characters)
15
+ self.native = set(characters)
16
+ self.character_ids = {c: i + 4 for i, c in enumerate(characters)}
17
+ self.id_characters = {i: c for c, i in self.character_ids.items()}
18
+ self.classes = len(characters) + 4
19
+
20
+ def encode(self, text):
21
+ if not text or text != unicodedata.normalize('NFC', text).strip():
22
+ raise ValueError('Require nonempty, stripped NFC text')
23
+ if any(c not in self.native for c in text):
24
+ raise ValueError('Text outside the fixed OCR alphabet')
25
+ return [0, *[self.character_ids[c] for c in text], 2], 'characters'
26
+
27
+ def decode(self, ids):
28
+ pieces = []
29
+ for index in ids:
30
+ if index in [0, 1, 2]:
31
+ continue
32
+ if index == 3:
33
+ pieces.append('\ufffd')
34
+ elif index in self.id_characters:
35
+ pieces.append(self.id_characters[index])
36
+ else:
37
+ raise ValueError('Unassigned character output ID')
38
+ return unicodedata.normalize('NFC', ''.join(pieces))
39
+
40
+ def manifest(self):
41
+ return {'version': 1, 'kind': 'literal_NFC_characters', 'classes': self.classes,
42
+ 'special_ids': {'BOS_serialization': 0, 'PAD': 1, 'EOS_and_decoder_start': 2, 'UNK': 3},
43
+ 'character_ids': self.character_ids, 'generation_suppressed_ids': [0, 1, 3],
44
+ 'training_target': 'Drop serialization BOS0 only; retain every text codepoint and EOS2',
45
+ 'unknown_output': 'Decode3 as U+FFFD, never silently remove it',
46
+ 'scope': 'Experimental codec, not recognition quality or Paddle qualification.'}
paddle/code/trocr_numpy_beam.py ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Batch-one NumPy beam state for the pinned TrOCR generation policy.
2
+
3
+ Implements Transformers4.57's finished/running beam rules. Equal-score top-k
4
+ ties use lower indices, explicitly; Torch CPU/CUDA tie order is not portable.
5
+ Source equivalence and complete OCR qualification must be measured separately.
6
+ """
7
+ import numpy as np
8
+
9
+
10
+ def top_indices(scores, count):
11
+ scores = np.asarray(scores)
12
+ assert scores.ndim == 1 and 1 <= count <= scores.size
13
+ assert not np.isnan(scores).any() and not np.isposinf(scores).any() and np.isfinite(scores).sum() >= count
14
+ threshold = np.partition(scores, scores.size - count)[scores.size - count]
15
+ better = np.flatnonzero(scores > threshold)
16
+ tied = np.flatnonzero(scores == threshold)[:count - len(better)]
17
+ indices = np.concatenate([better, tied])
18
+ return indices[np.lexsort((indices, -scores[indices]))]
19
+
20
+
21
+ def log_softmax(scores):
22
+ scores = np.asarray(scores, dtype=np.float32)
23
+ shifted = scores - scores.max(axis=-1, keepdims=True)
24
+ return shifted - np.log(np.exp(shifted).sum(axis=-1, keepdims=True))
25
+
26
+
27
+ class TrOCRBeamState:
28
+ def __init__(self, beams=10, max_new_tokens=256, length_penalty=1., suppress_tokens=()):
29
+ if beams < 2 or not 1 <= max_new_tokens <= 512 or length_penalty < 0:
30
+ raise ValueError('Unsupported beam search settings')
31
+ self.beams = beams;self.maximum = max_new_tokens + 1;self.penalty = length_penalty
32
+ self.suppressed = tuple(suppress_tokens)
33
+ if any(type(t) is not int or t < 0 for t in self.suppressed) or len(set(self.suppressed)) != len(self.suppressed):
34
+ raise ValueError('Suppressed token IDs must be unique nonnegative integers')
35
+ self.current = 1
36
+ self.running = np.full((beams, self.maximum), 1, np.int64);self.running[:, 0] = 2
37
+ self.running_scores = np.full(beams, -1e9, np.float32);self.running_scores[0] = 0
38
+ self.finished = self.running.copy();self.finished_scores = np.full(beams, -1e9, np.float32)
39
+ self.finished_flags = np.zeros(beams, bool);self.finished_lengths = np.zeros(beams, np.int64)
40
+ self.done = False
41
+
42
+ def advance(self, logits):
43
+ logits = np.asarray(logits, dtype=np.float32)
44
+ if self.done or logits.ndim != 2 or logits.shape[0] != self.beams or logits.shape[1] < 3 or not np.isfinite(logits).all():
45
+ raise ValueError('Invalid scores or completed beam search')
46
+ classes = logits.shape[1]
47
+ if self.suppressed and max(self.suppressed) >= classes:raise ValueError('Suppressed ID outside vocabulary')
48
+ logprobs = log_softmax(logits)
49
+ # HF applies suppression after log-softmax, without renormalization.
50
+ logprobs[:, self.suppressed] = -np.inf
51
+ accumulated = logprobs + self.running_scores[:, None]
52
+ choices = top_indices(accumulated.reshape(-1), 2 * self.beams)
53
+ scores = accumulated.reshape(-1)[choices]
54
+ parents, tokens = choices // classes, choices % classes
55
+ candidates = self.running[parents].copy();candidates[:, self.current] = tokens
56
+ stopped = (tokens == 2) | (self.current + 1 == self.maximum)
57
+
58
+ live_scores = scores + stopped.astype(np.float32) * np.float32(-1e9)
59
+ live = top_indices(live_scores, self.beams)
60
+ self.running = candidates[live].copy();self.running_scores = live_scores[live].copy()
61
+
62
+ eligible = stopped & (np.arange(2 * self.beams) < self.beams)
63
+ normalized = scores / np.float32(self.current ** self.penalty)
64
+ normalized = normalized + (~eligible).astype(np.float32) * np.float32(-1e9)
65
+ merged_scores = np.concatenate([self.finished_scores, normalized])
66
+ selected = top_indices(merged_scores, self.beams)
67
+ self.finished = np.concatenate([self.finished, candidates])[selected].copy()
68
+ self.finished_scores = merged_scores[selected].copy()
69
+ self.finished_flags = np.concatenate([self.finished_flags, eligible])[selected].copy()
70
+ self.finished_lengths = np.concatenate([self.finished_lengths, np.full(2 * self.beams, self.current, np.int64)])[selected].copy()
71
+
72
+ self.current += 1
73
+ possible = self.running_scores[0] / np.float32((self.current - 1) ** self.penalty)
74
+ worst = self.finished_scores.min() if self.finished_flags.all() else np.float32(-1e9)
75
+ self.done = bool(possible <= worst or stopped.all())
76
+ return parents[live].copy(), tokens[live].astype(np.int64, copy=True)
77
+
78
+ def result(self):
79
+ if not self.done or not self.finished_flags[0]:raise ValueError('Beam search has no completed result')
80
+ return self.finished[0, :1 + self.finished_lengths[0]].tolist(), float(self.finished_scores[0])
paddle/code/trocr_paddle_norm_probe.LICENSE ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The source-order Welford and softmax prototypes in
2
+ trocr_paddle_norm_probe.py and trocr_paddle_attention_probe.py follow the
3
+ PyTorch ATen reduction algorithms at commit
4
+ 08187d9e0fba026dc8217405802ab5381dc88d90:
5
+ https://github.com/pytorch/pytorch/blob/08187d9e0fba026dc8217405802ab5381dc88d90/aten/src/ATen/native/cpu/moments_utils.h
6
+
7
+ https://github.com/pytorch/pytorch/blob/08187d9e0fba026dc8217405802ab5381dc88d90/aten/src/ATen/cpu/vec/functional_base.h
8
+ https://github.com/pytorch/pytorch/blob/08187d9e0fba026dc8217405802ab5381dc88d90/aten/src/ATen/native/cpu/SoftMaxKernel.cpp
9
+
10
+ The following upstream license notice is retained for those adaptations.
11
+ The prototype is experimental and has not passed the native numerical gate.
12
+
13
+ From PyTorch:
14
+
15
+ Copyright (c) 2016- Facebook, Inc (Adam Paszke)
16
+ Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
17
+ Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
18
+ Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
19
+ Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu)
20
+ Copyright (c) 2011-2013 NYU (Clement Farabet)
21
+ Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston)
22
+ Copyright (c) 2006 Idiap Research Institute (Samy Bengio)
23
+ Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz)
24
+
25
+ From Caffe2:
26
+
27
+ Copyright (c) 2016-present, Facebook Inc. All rights reserved.
28
+
29
+ All contributions by Facebook:
30
+ Copyright (c) 2016 Facebook Inc.
31
+
32
+ All contributions by Google:
33
+ Copyright (c) 2015 Google Inc.
34
+ All rights reserved.
35
+
36
+ All contributions by Yangqing Jia:
37
+ Copyright (c) 2015 Yangqing Jia
38
+ All rights reserved.
39
+
40
+ All contributions by Kakao Brain:
41
+ Copyright 2019-2020 Kakao Brain
42
+
43
+ All contributions by Cruise LLC:
44
+ Copyright (c) 2022 Cruise LLC.
45
+ All rights reserved.
46
+
47
+ All contributions by Tri Dao:
48
+ Copyright (c) 2024 Tri Dao.
49
+ All rights reserved.
50
+
51
+ All contributions by Arm:
52
+ Copyright (c) 2021, 2023-2025 Arm Limited and/or its affiliates
53
+
54
+ All contributions from Caffe:
55
+ Copyright(c) 2013, 2014, 2015, the respective contributors
56
+ All rights reserved.
57
+
58
+ All other contributions:
59
+ Copyright(c) 2015, 2016 the respective contributors
60
+ All rights reserved.
61
+
62
+ Caffe2 uses a copyright model similar to Caffe: each contributor holds
63
+ copyright over their contributions to Caffe2. The project versioning records
64
+ all such contribution and copyright details. If a contributor wants to further
65
+ mark their specific copyright on a particular contribution, they should
66
+ indicate their copyright solely in the commit message of the change when it is
67
+ committed.
68
+
69
+ All rights reserved.
70
+
71
+ Redistribution and use in source and binary forms, with or without
72
+ modification, are permitted provided that the following conditions are met:
73
+
74
+ 1. Redistributions of source code must retain the above copyright
75
+ notice, this list of conditions and the following disclaimer.
76
+
77
+ 2. Redistributions in binary form must reproduce the above copyright
78
+ notice, this list of conditions and the following disclaimer in the
79
+ documentation and/or other materials provided with the distribution.
80
+
81
+ 3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories America
82
+ and IDIAP Research Institute nor the names of its contributors may be
83
+ used to endorse or promote products derived from this software without
84
+ specific prior written permission.
85
+
86
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
87
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
88
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
89
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
90
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
91
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
92
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
93
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
94
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
95
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
96
+ POSSIBILITY OF SUCH DAMAGE.
paddle/code/trocr_paddle_sleef_probe.LICENSE ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The experimental xexpf adaptation in trocr_paddle_sleef_probe.py follows SLEEF
2
+ commit 5a1d179df9cf652951b59010a2d2075372d67f68, the submodule pinned by
3
+ PyTorch commit 08187d9e0fba026dc8217405802ab5381dc88d90.
4
+ Source: https://github.com/shibatch/sleef/blob/5a1d179df9cf652951b59010a2d2075372d67f68/src/libm/sleefsimdsp.c
5
+
6
+ // Copyright Naoki Shibata and contributors 2010 - 2024.
7
+ // Distributed under the Boost Software License, Version 1.0.
8
+ // (See accompanying file LICENSE.txt or copy at
9
+ // http://www.boost.org/LICENSE_1_0.txt)
10
+
11
+ Boost Software License - Version 1.0 - August 17th, 2003
12
+
13
+ Permission is hereby granted, free of charge, to any person or organization
14
+ obtaining a copy of the software and accompanying documentation covered by
15
+ this license (the "Software") to use, reproduce, display, distribute,
16
+ execute, and transmit the Software, and to prepare derivative works of the
17
+ Software, and to permit third-parties to whom the Software is furnished to
18
+ do so, all subject to the following:
19
+
20
+ The copyright notices in the Software and this entire statement, including
21
+ the above license grant, this restriction and the following disclaimer,
22
+ must be included in all copies of the Software, in whole or in part, and
23
+ all derivative works of the Software, unless such copies or derivative
24
+ works are solely in the form of machine-executable object code generated by
25
+ a source language processor.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
30
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
31
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
32
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
33
+ DEALINGS IN THE SOFTWARE.
paddle/code/trocr_selective_onednn_pass.LICENSE ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
paddle/code/trocr_selective_onednn_pass.cc ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
2
+ // Copyright (c) 2026 OCR Tech contributors.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ // Adapted from Paddle v3.3.1 onednn_placement_pass.cc; see the adjacent LICENSE.
5
+ // Restrict placement to the two source-matched primitives, leaving BLAS intact.
6
+ #include <iostream>
7
+ #include "paddle/fluid/pir/dialect/operator/interface/op_yaml_info.h"
8
+ #include "paddle/fluid/pir/dialect/operator/utils/op_yaml_info_util.h"
9
+ #include "paddle/pir/include/pass/pass.h"
10
+ #include "paddle/pir/include/pass/pass_registry.h"
11
+ #include "paddle/pir/include/pattern_rewrite/pattern_match.h"
12
+
13
+ namespace {
14
+ class SelectPrimitive final : public pir::RewritePattern {
15
+ public:
16
+ SelectPrimitive(const std::string& name, pir::IrContext* context)
17
+ : pir::RewritePattern(name, 1, context) {}
18
+ bool MatchAndRewrite(pir::Operation* op,
19
+ pir::PatternRewriter& rewriter) const override {
20
+ const auto name = op->name();
21
+ if (name != "pd_op.conv2d" && name != "pd_op.gelu") return false;
22
+ const auto target = "onednn_op" + name.substr(5);
23
+ const auto info = pir::IrContext::Instance()->GetRegisteredOpInfo(target);
24
+ PADDLE_ENFORCE_EQ(bool(info), true,
25
+ common::errors::NotFound("Missing selective primitive %s", target));
26
+ auto attrs = op->attributes();
27
+ const auto* yaml = info.GetInterfaceImpl<paddle::dialect::OpYamlInfoInterface>();
28
+ const auto runtime = std::get<3>(yaml->get_op_info_(target));
29
+ for (const auto& entry : runtime.extra_args_default_value) attrs[entry.first] = entry.second;
30
+ if (attrs.count("is_test")) attrs["is_test"] = rewriter.bool_attr(true);
31
+ std::vector<pir::Type> types;
32
+ for (size_t i = 0; i < op->num_results(); ++i) types.push_back(op->result_type(i));
33
+ auto* replacement = rewriter.Build(op->operands_source(), attrs, types, info);
34
+ rewriter.ReplaceOp(op, replacement->results());
35
+ std::cerr << "OCR_SELECTIVE_ONEDNN " << name << " -> " << target << std::endl;
36
+ return true;
37
+ }
38
+ };
39
+
40
+ class SelectivePass final : public pir::PatternRewritePass {
41
+ public:
42
+ SelectivePass() : pir::PatternRewritePass("ocr_conv_gelu_onednn_v1", 2) {}
43
+ pir::RewritePatternSet InitializePatterns(pir::IrContext* context) override {
44
+ pir::RewritePatternSet patterns(context);
45
+ for (const auto& name : {"pd_op.conv2d", "pd_op.gelu"}) {
46
+ patterns.Add(std::make_unique<SelectPrimitive>(name, context));
47
+ }
48
+ return patterns;
49
+ }
50
+ };
51
+ } // namespace
52
+ REGISTER_IR_PASS(ocr_conv_gelu_onednn_v1, SelectivePass);
paddle/code/trocr_source_cpu_ops.cc ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Experimental Paddle CPU operators for the fixed TrOCR encoder profile.
2
+ // Welford/reduction order follows pinned PyTorch; exp follows pinned SLEEF.
3
+ // Retain trocr_paddle_norm_probe.LICENSE and trocr_paddle_sleef_probe.LICENSE.
4
+ #include <array>
5
+ #include <cfenv>
6
+ #include <cmath>
7
+ #include <cstdint>
8
+ #include <vector>
9
+ #include "paddle/extension.h"
10
+
11
+ namespace {
12
+ constexpr int kWidth = 384;
13
+ constexpr int kAttention = 578;
14
+ struct Moments {
15
+ int count = 0;
16
+ std::array<float, 8> mean{};
17
+ std::array<float, 8> m2{};
18
+ };
19
+ void Merge(Moments& dst, const Moments& src) {
20
+ const int old = dst.count;
21
+ const float factor = float(src.count) / float(old + src.count);
22
+ for (int i = 0; i < 8; ++i) {
23
+ const float delta = src.mean[i] - dst.mean[i];
24
+ const float scaled = factor * delta;
25
+ dst.mean[i] = dst.mean[i] + scaled;
26
+ dst.m2[i] = std::fma(delta * float(old), scaled, dst.m2[i] + src.m2[i]);
27
+ }
28
+ dst.count += src.count;
29
+ }
30
+ void CheckCPU(const paddle::Tensor& value) {
31
+ PD_CHECK(value.is_cpu(), "Source-order research operators require CPU inputs.");
32
+ PD_CHECK(value.dtype() == paddle::DataType::FLOAT32, "Require FP32 inputs.");
33
+ PD_CHECK(std::fegetround() == FE_TONEAREST, "Require round-to-nearest floating point.");
34
+ }
35
+ float NegativeExp(float d) {
36
+ if (d < -104.f) return 0.f;
37
+ const int q = int(std::nearbyint(d * 1.4426950408889634073599246810018921374f));
38
+ float s = std::fma(float(q), -0.693145751953125f, d);
39
+ s = std::fma(float(q), -1.428606765330187045e-6f, s);
40
+ float u = 0.000198527617612853646278381f;
41
+ u = std::fma(u, s, 0.00139304355252534151077271f);
42
+ u = std::fma(u, s, 0.00833336077630519866943359f);
43
+ u = std::fma(u, s, 0.0416664853692054748535156f);
44
+ u = std::fma(u, s, 0.166666671633720397949219f);
45
+ u = std::fma(u, s, 0.5f);
46
+ u = 1.f + std::fma(s * s, u, s);
47
+ const int half = int(std::floor(float(q) * .5f));
48
+ return std::ldexp(std::ldexp(u, half), q - half);
49
+ }
50
+ } // namespace
51
+
52
+ std::vector<paddle::Tensor> SourceNorm384(const paddle::Tensor& x,
53
+ const paddle::Tensor& gamma,
54
+ const paddle::Tensor& beta) {
55
+ CheckCPU(x); CheckCPU(gamma); CheckCPU(beta);
56
+ PD_CHECK(!x.shape().empty() && x.shape().back() == kWidth, "Require 384 channels.");
57
+ PD_CHECK(gamma.numel() == kWidth && beta.numel() == kWidth, "Require 384 affine values.");
58
+ auto out = paddle::empty(x.shape(), x.dtype(), x.place());
59
+ const float* input = x.data<float>();
60
+ const float* weight = gamma.data<float>();
61
+ const float* bias = beta.data<float>();
62
+ float* result = out.data<float>();
63
+ for (int64_t row = 0; row < x.numel() / kWidth; ++row) {
64
+ const float* values = input + row * kWidth;
65
+ Moments first, second;
66
+ for (int chunk = 0; chunk < 3; ++chunk) {
67
+ Moments local; local.count = 16;
68
+ for (int j = 0; j < 16; ++j) {
69
+ const float factor = 1.f / float(j + 1);
70
+ for (int lane = 0; lane < 8; ++lane) {
71
+ const float value = values[chunk * 128 + j * 8 + lane];
72
+ const float delta = value - local.mean[lane];
73
+ local.mean[lane] = std::fma(factor, delta, local.mean[lane]);
74
+ local.m2[lane] = std::fma(delta, value - local.mean[lane], local.m2[lane]);
75
+ }
76
+ }
77
+ Merge(first, local);
78
+ if (chunk == 1) { Merge(second, first); first = Moments{}; }
79
+ }
80
+ Merge(first, second);
81
+ float mean = 0.f, m2 = 0.f;
82
+ for (int lane = 0; lane < 8; ++lane) {
83
+ const float factor = 48.f / float((lane + 1) * 48);
84
+ const float delta = first.mean[lane] - mean;
85
+ mean = std::fma(factor, delta, mean);
86
+ const float correction = (delta * delta) * factor;
87
+ m2 = m2 + std::fma(correction, float(lane * 48), first.m2[lane]);
88
+ }
89
+ const float variance = m2 / float(kWidth);
90
+ const float scale = 1.f / std::sqrt(variance + 1e-12f);
91
+ for (int i = 0; i < kWidth; ++i) {
92
+ const float normalized = (values[i] - mean) * scale;
93
+ result[row * kWidth + i] = std::fma(normalized, weight[i], bias[i]);
94
+ }
95
+ }
96
+ return {out};
97
+ }
98
+
99
+ std::vector<paddle::Tensor> SourceSoftmax578(const paddle::Tensor& x) {
100
+ CheckCPU(x);
101
+ PD_CHECK(!x.shape().empty() && x.shape().back() == kAttention, "Require 578 attention scores.");
102
+ auto out = paddle::empty(x.shape(), x.dtype(), x.place());
103
+ const float* input = x.data<float>(); float* output = out.data<float>();
104
+ for (int64_t row = 0; row < x.numel() / kAttention; ++row) {
105
+ const float* values = input + row * kAttention;
106
+ float* result = output + row * kAttention;
107
+ float maximum = values[0];
108
+ for (int i = 0; i < kAttention; ++i) {
109
+ PD_CHECK(std::isfinite(values[i]), "Require finite scores.");
110
+ if (values[i] > maximum) maximum = values[i];
111
+ }
112
+ for (int i = 0; i < kAttention; ++i) result[i] = NegativeExp(values[i] - maximum);
113
+ std::array<float, 16> sum;
114
+ for (int i = 0; i < 16; ++i) sum[i] = result[i];
115
+ for (int block = 1; block < 36; ++block)
116
+ for (int lane = 0; lane < 16; ++lane) sum[lane] = sum[lane] + result[block * 16 + lane];
117
+ for (int lane = 0; lane < 2; ++lane) sum[lane] = sum[lane] + result[576 + lane];
118
+ for (int width : {8, 4, 2, 1})
119
+ for (int lane = 0; lane < width; ++lane) sum[lane] = sum[lane] + sum[lane + width];
120
+ const float inverse = 1.f / sum[0];
121
+ for (int i = 0; i < kAttention; ++i) result[i] = result[i] * inverse;
122
+ }
123
+ return {out};
124
+ }
125
+
126
+ std::vector<std::vector<int64_t>> NormShape(const std::vector<int64_t>& x,
127
+ const std::vector<int64_t>& gamma,
128
+ const std::vector<int64_t>& beta) { return {x}; }
129
+ std::vector<paddle::DataType> NormType(paddle::DataType x, paddle::DataType gamma,
130
+ paddle::DataType beta) { return {x}; }
131
+ std::vector<std::vector<int64_t>> SoftmaxShape(const std::vector<int64_t>& x) { return {x}; }
132
+ std::vector<paddle::DataType> SoftmaxType(paddle::DataType x) { return {x}; }
133
+
134
+ PD_BUILD_OP(ocr_source_norm384_v1)
135
+ .Inputs({"X", "Gamma", "Beta"}).Outputs({"Out"})
136
+ .SetKernelFn(PD_KERNEL(SourceNorm384))
137
+ .SetInferShapeFn(PD_INFER_SHAPE(NormShape)).SetInferDtypeFn(PD_INFER_DTYPE(NormType));
138
+ PD_BUILD_OP(ocr_source_softmax578_v1)
139
+ .Inputs({"X"}).Outputs({"Out"})
140
+ .SetKernelFn(PD_KERNEL(SourceSoftmax578))
141
+ .SetInferShapeFn(PD_INFER_SHAPE(SoftmaxShape)).SetInferDtypeFn(PD_INFER_DTYPE(SoftmaxType));
paddle/decoders/character/decoder-step.json ADDED
The diff for this file is too large to render. See raw diff
 
paddle/decoders/character/decoder-step.pdiparams ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e35ba8d8743abdcf8b6cdb48a572a669cbf3e504d38d2a48827b68657e32aeff
3
+ size 23830010
paddle/decoders/english/decoder-step.json ADDED
The diff for this file is too large to render. See raw diff
 
paddle/decoders/english/decoder-step.pdiparams ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec5ec71ad13c5305a1a95c8c2846c4de526571e58ce8df00fa5dbac529940a16
3
+ size 153818620
paddle/decoders/report.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "scope": "Export the two disjoint cached Paddle decoders for the shared encoder.\n\nRound-trip/count every decoder parameter. This completes graph assets only:\ncached numerical trajectories, beam generation and native CER remain untested.\nNo Torch, duplicate encoder, checkpoint modification or deployment.\n",
3
+ "candidate_manifest_sha256": "0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede",
4
+ "bundle_identity": {
5
+ "candidate_manifest_sha256": "0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede",
6
+ "weights_sha256": "9b58d252978d3a5d33adcdaea95e113162daf5146e20a9e1b8aa47e21e48ed93",
7
+ "trained_bundle": true,
8
+ "control_weights": false,
9
+ "source_sha256": {
10
+ "audit_shared_character_training.py": "3eccbe9b38f6c4aa255ac96d5bbe3229631cf0d1eb9b9a0ee1a6665e5b52b323",
11
+ "character_handwriting_curriculum.py": "ac6aeac728da7c20e1d5a16248aca81f5522d6614629b07052679d288259e53e",
12
+ "shared_character_recognizer.py": "0498d8b7d61f3c8e4a4fdcd927a507464cfaf8156bf874a211484a5474697719",
13
+ "shared_character_training.py": "b0991c9fd0da42c736c4d5b36f9b64f23c9be94303a259867402e8e4cfd42012",
14
+ "shared_private_protocol.py": "49384fcd48140482e0efc9a190c56878dc8d6d367f3d85aa843f948a269152b1",
15
+ "train_shared_character_private.py": "d50a1ea8f2f13fefe2f3a5166ddc417aee4c42c2da1ef2ff90c2602d5788fc3a",
16
+ "training_checkpoint.py": "569a4ca5b0a81b29f678e066e8bfa5bd337fcc2785bbc4b5d0dfd3e8dea7a051",
17
+ "trocr_character_codec.py": "7ede21e57fd4985153570820873abf690cc48de2e677b38828753fbedfdbd5e2",
18
+ "trocr_training_loss.py": "cb722cf44ef61f883f0e932763fe5566ecbab1d05a4f69ad68e466334d188f86"
19
+ },
20
+ "weight_verification_sha256": "693a3c2542b1a0284fd3967827dbbb77621e0d155ac62f32f00f2eb3a623f2de"
21
+ },
22
+ "encoder_report_sha256": "6e19e7fe532e7d24d504f9e323e08d5c77e1ca07ceaeb1ebcc0f616369834dbc",
23
+ "encoder_parameters": 30432384,
24
+ "decoders": {
25
+ "english": {
26
+ "parameters": 38453760,
27
+ "classes": 64044,
28
+ "serialized_neural_population_byte_exact": true,
29
+ "graph_sha256": {
30
+ "decoder-step.json": "eaea1b3b5001549a6d0a4c4b1bd810371a82bdae2092452ac2f73214762ede95",
31
+ "decoder-step.pdiparams": "ec5ec71ad13c5305a1a95c8c2846c4de526571e58ce8df00fa5dbac529940a16"
32
+ }
33
+ },
34
+ "character": {
35
+ "parameters": 5956608,
36
+ "classes": 573,
37
+ "serialized_neural_population_byte_exact": true,
38
+ "graph_sha256": {
39
+ "decoder-step.json": "555d79e651df3b22fef37f7cc873c843678c135bbe39e69488f4ef3b2acb3e5d",
40
+ "decoder-step.pdiparams": "e35ba8d8743abdcf8b6cdb48a572a669cbf3e504d38d2a48827b68657e32aeff"
41
+ }
42
+ }
43
+ },
44
+ "total_graph_neural_values": 74842752,
45
+ "total_with_100k_router_reserve": 74942752,
46
+ "every_source_tensor_owned_once": true,
47
+ "no_duplicate_encoder": true,
48
+ "encoder_library": {
49
+ "path": "/home/ampixa/ocr/ocr-deva-ft/diagnostics/shared-private-continuation-native-r1-20261023/8000/encoder/build/ocr_source_selective_v1/ocr_source_selective_v1.so",
50
+ "sha256": "fce69529c6a3752247be1192a495de7d1c395f8493039ad0d17546a42f936c60"
51
+ },
52
+ "source_sha256": {
53
+ "export_shared_character_decoders.py": "117dfabb79c52c32778d8e31e6ecb702f07d83db12b23cd14c1e46ac92e96687",
54
+ "shared_character_paddle.py": "d3947e59ada6971a8ce03a40d94886bd188e147a36872ca255798e4974dc3521",
55
+ "trocr_paddle_graphs.py": "13422f5004d84084e02dcf5d7fbc17623e9d17f6e7d67be256c5a05b122a880b",
56
+ "shared_bundle_identity.py": "e696082c61d0f1e3dfc76130e3496d9964a517e2097b7cd15525de9cb267660f"
57
+ },
58
+ "decoder_numerical_qualified": false,
59
+ "generation_qualified": false,
60
+ "quality_measured": false,
61
+ "native_Paddle_qualified": false,
62
+ "model_promoted": false
63
+ }
paddle/encoder-library.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fce69529c6a3752247be1192a495de7d1c395f8493039ad0d17546a42f936c60
3
+ size 5347952
paddle/encoder/encoder.json ADDED
The diff for this file is too large to render. See raw diff
 
paddle/encoder/encoder.pdiparams ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2a632ecd78bd35441f0575b5073ebdfe2dd8edebff08c892b386205655700b0
3
+ size 121743123
paddle/encoder/report.json ADDED
@@ -0,0 +1,408 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "scope": "Export one actual conditional Paddle encoder and check all24 source fixtures.\n\nCount every saved neural value, including conditional factors. No source tensor\ninjection, separate full encoder, decoder, beam generation or quality claim.\nThe unchanged1e-4 bound applies to both branches; failure never changes it.\n",
3
+ "run_sha256": "42c4cf89a86fc3de900949348079f7b0c90d4e58ca2d28a105e326785a3eacd5",
4
+ "parameters": 30432384,
5
+ "whole_candidate_parameters": 74842752,
6
+ "saved_neural_population_byte_exact": true,
7
+ "single_shared_encoder": true,
8
+ "records": [
9
+ {
10
+ "id": "nep_hw:images/nep_2122.jpg",
11
+ "branch": "english",
12
+ "max_errors": [
13
+ 0.0,
14
+ 0.0
15
+ ],
16
+ "byte_exact": [
17
+ true,
18
+ true
19
+ ],
20
+ "numerical_pass": true,
21
+ "inference_seconds": 1.3473792765289545,
22
+ "file": "training-00.npz",
23
+ "sha256": "982a19949ee70841849fed810b856bdba91d010cf8102162d7afa8d9741586e0"
24
+ },
25
+ {
26
+ "id": "nep_hw:images/nep_2122.jpg",
27
+ "branch": "character",
28
+ "max_errors": [
29
+ 0.0,
30
+ 0.0
31
+ ],
32
+ "byte_exact": [
33
+ true,
34
+ true
35
+ ],
36
+ "numerical_pass": true,
37
+ "inference_seconds": 0.7976739667356014,
38
+ "file": "training-01.npz",
39
+ "sha256": "977d69d27433eb0e2e08a94c539743f0554c99e677395bf6e4829c0cde4701d0"
40
+ },
41
+ {
42
+ "id": "nep_hw:images/nep_769.jpg",
43
+ "branch": "english",
44
+ "max_errors": [
45
+ 0.0,
46
+ 0.0
47
+ ],
48
+ "byte_exact": [
49
+ true,
50
+ true
51
+ ],
52
+ "numerical_pass": true,
53
+ "inference_seconds": 0.6514115799218416,
54
+ "file": "training-02.npz",
55
+ "sha256": "245197df27ae2a11e71b003c008dadfe25499f25358b5e322b03e3ba0cf6b0be"
56
+ },
57
+ {
58
+ "id": "nep_hw:images/nep_769.jpg",
59
+ "branch": "character",
60
+ "max_errors": [
61
+ 0.0,
62
+ 0.0
63
+ ],
64
+ "byte_exact": [
65
+ true,
66
+ true
67
+ ],
68
+ "numerical_pass": true,
69
+ "inference_seconds": 0.6233616527169943,
70
+ "file": "training-03.npz",
71
+ "sha256": "0247fe245a5f3b90c6d2e754025a299273d8d6f08ae170debfc0353270a4f02a"
72
+ },
73
+ {
74
+ "id": "nep_hw:images/nep_3325.jpg",
75
+ "branch": "english",
76
+ "max_errors": [
77
+ 0.0,
78
+ 0.0
79
+ ],
80
+ "byte_exact": [
81
+ true,
82
+ true
83
+ ],
84
+ "numerical_pass": true,
85
+ "inference_seconds": 0.6163665913045406,
86
+ "file": "training-04.npz",
87
+ "sha256": "aca9384656eecd2a391ba6bd5e34a3ee7a48cfec0c3c63969397f54903318daa"
88
+ },
89
+ {
90
+ "id": "nep_hw:images/nep_3325.jpg",
91
+ "branch": "character",
92
+ "max_errors": [
93
+ 0.0,
94
+ 0.0
95
+ ],
96
+ "byte_exact": [
97
+ true,
98
+ true
99
+ ],
100
+ "numerical_pass": true,
101
+ "inference_seconds": 0.6238061562180519,
102
+ "file": "training-05.npz",
103
+ "sha256": "2b02130c4d892ff8c2277f3418d93ecd6374b4f85fb0bbaa4fd295c683c2dbfa"
104
+ },
105
+ {
106
+ "id": "nep_hw:images/nep_1370.jpg",
107
+ "branch": "english",
108
+ "max_errors": [
109
+ 0.0,
110
+ 0.0
111
+ ],
112
+ "byte_exact": [
113
+ true,
114
+ true
115
+ ],
116
+ "numerical_pass": true,
117
+ "inference_seconds": 0.6203578859567642,
118
+ "file": "training-06.npz",
119
+ "sha256": "f7c672af41633ec3b4355cbe29244b7d01ca6ac5a766772248ba8f9d28ab35fc"
120
+ },
121
+ {
122
+ "id": "nep_hw:images/nep_1370.jpg",
123
+ "branch": "character",
124
+ "max_errors": [
125
+ 0.0,
126
+ 0.0
127
+ ],
128
+ "byte_exact": [
129
+ true,
130
+ true
131
+ ],
132
+ "numerical_pass": true,
133
+ "inference_seconds": 0.6171446871012449,
134
+ "file": "training-07.npz",
135
+ "sha256": "a09266470b57ba8a3070f3db33b50556df611f768a70749a53a9bbb46d8d0d36"
136
+ },
137
+ {
138
+ "id": "iiit_hw:images/train-00001-of-00003_022703.jpg",
139
+ "branch": "english",
140
+ "max_errors": [
141
+ 0.0,
142
+ 0.0
143
+ ],
144
+ "byte_exact": [
145
+ true,
146
+ true
147
+ ],
148
+ "numerical_pass": true,
149
+ "inference_seconds": 0.634559752419591,
150
+ "file": "training-08.npz",
151
+ "sha256": "ac94b53c1ff084b2a48225947b1a4d0482c75c2ec2ee5699f312701030e05a34"
152
+ },
153
+ {
154
+ "id": "iiit_hw:images/train-00001-of-00003_022703.jpg",
155
+ "branch": "character",
156
+ "max_errors": [
157
+ 0.0,
158
+ 0.0
159
+ ],
160
+ "byte_exact": [
161
+ true,
162
+ true
163
+ ],
164
+ "numerical_pass": true,
165
+ "inference_seconds": 0.6346047893166542,
166
+ "file": "training-09.npz",
167
+ "sha256": "d8c1cdd1b7df84f20010e10309e55bd14b38286cdb35414034caeb4dafb2d282"
168
+ },
169
+ {
170
+ "id": "iiit_hw:images/train-00002-of-00003_018536.jpg",
171
+ "branch": "english",
172
+ "max_errors": [
173
+ 0.0,
174
+ 0.0
175
+ ],
176
+ "byte_exact": [
177
+ true,
178
+ true
179
+ ],
180
+ "numerical_pass": true,
181
+ "inference_seconds": 0.6370339300483465,
182
+ "file": "training-10.npz",
183
+ "sha256": "2d5c6487cc3a36874d248cd831be2a83cac615d904a24c99c407bcbeb16abef0"
184
+ },
185
+ {
186
+ "id": "iiit_hw:images/train-00002-of-00003_018536.jpg",
187
+ "branch": "character",
188
+ "max_errors": [
189
+ 0.0,
190
+ 0.0
191
+ ],
192
+ "byte_exact": [
193
+ true,
194
+ true
195
+ ],
196
+ "numerical_pass": true,
197
+ "inference_seconds": 0.6340623814612627,
198
+ "file": "training-11.npz",
199
+ "sha256": "cd260e997b84766aa65f74e396adf55a08553fa43fa4289b6bd70d9af2e50f6e"
200
+ },
201
+ {
202
+ "id": "iiit_hw:images/train-00001-of-00003_003887.jpg",
203
+ "branch": "english",
204
+ "max_errors": [
205
+ 0.0,
206
+ 0.0
207
+ ],
208
+ "byte_exact": [
209
+ true,
210
+ true
211
+ ],
212
+ "numerical_pass": true,
213
+ "inference_seconds": 0.6398916430771351,
214
+ "file": "training-12.npz",
215
+ "sha256": "c43f5416adf537f40b6ed304ee68477d089c58dc55675f559f5f53173f1e388e"
216
+ },
217
+ {
218
+ "id": "iiit_hw:images/train-00001-of-00003_003887.jpg",
219
+ "branch": "character",
220
+ "max_errors": [
221
+ 0.0,
222
+ 0.0
223
+ ],
224
+ "byte_exact": [
225
+ true,
226
+ true
227
+ ],
228
+ "numerical_pass": true,
229
+ "inference_seconds": 0.6324335876852274,
230
+ "file": "training-13.npz",
231
+ "sha256": "8146a072dc32ea5c11b3b7f266f01de1fdc33b12459f170844d60d7ff2e35850"
232
+ },
233
+ {
234
+ "id": "iiit_hw:images/train-00002-of-00003_005824.jpg",
235
+ "branch": "english",
236
+ "max_errors": [
237
+ 0.0,
238
+ 0.0
239
+ ],
240
+ "byte_exact": [
241
+ true,
242
+ true
243
+ ],
244
+ "numerical_pass": true,
245
+ "inference_seconds": 0.6408481299877167,
246
+ "file": "training-14.npz",
247
+ "sha256": "af9b1bc5a787894468fe9aa51855249b03ae86b2208ebf3ed74c92ff40973495"
248
+ },
249
+ {
250
+ "id": "iiit_hw:images/train-00002-of-00003_005824.jpg",
251
+ "branch": "character",
252
+ "max_errors": [
253
+ 0.0,
254
+ 0.0
255
+ ],
256
+ "byte_exact": [
257
+ true,
258
+ true
259
+ ],
260
+ "numerical_pass": true,
261
+ "inference_seconds": 0.6478282399475574,
262
+ "file": "training-15.npz",
263
+ "sha256": "3d76153d3aa898f5d5553f4663d60bd67daf8447e0e296ca0a71be7b898da9bc"
264
+ },
265
+ {
266
+ "id": "en_hw:images/train_003860.jpg",
267
+ "branch": "english",
268
+ "max_errors": [
269
+ 0.0,
270
+ 0.0
271
+ ],
272
+ "byte_exact": [
273
+ true,
274
+ true
275
+ ],
276
+ "numerical_pass": true,
277
+ "inference_seconds": 0.6384864822030067,
278
+ "file": "training-16.npz",
279
+ "sha256": "305e75cfd3943b5d63056465544c36f2eb3c19b15c19d765f7fb2aa9ea3aae94"
280
+ },
281
+ {
282
+ "id": "en_hw:images/train_003860.jpg",
283
+ "branch": "character",
284
+ "max_errors": [
285
+ 0.0,
286
+ 0.0
287
+ ],
288
+ "byte_exact": [
289
+ true,
290
+ true
291
+ ],
292
+ "numerical_pass": true,
293
+ "inference_seconds": 0.6323059760034084,
294
+ "file": "training-17.npz",
295
+ "sha256": "fd35160165f846ffee5fe97706fbfc7583524c41fb71b4de72b721cc33ac0626"
296
+ },
297
+ {
298
+ "id": "en_hw:images/train_002056.jpg",
299
+ "branch": "english",
300
+ "max_errors": [
301
+ 0.0,
302
+ 0.0
303
+ ],
304
+ "byte_exact": [
305
+ true,
306
+ true
307
+ ],
308
+ "numerical_pass": true,
309
+ "inference_seconds": 0.6381492856889963,
310
+ "file": "training-18.npz",
311
+ "sha256": "e4a3e8cabf0b12f93f1ee417803b799598f7b1187b071ac454a8b679ed05712d"
312
+ },
313
+ {
314
+ "id": "en_hw:images/train_002056.jpg",
315
+ "branch": "character",
316
+ "max_errors": [
317
+ 0.0,
318
+ 0.0
319
+ ],
320
+ "byte_exact": [
321
+ true,
322
+ true
323
+ ],
324
+ "numerical_pass": true,
325
+ "inference_seconds": 0.6392509918659925,
326
+ "file": "training-19.npz",
327
+ "sha256": "a59b65b6edddbb1e222872dcf5cbbf6d6a1efda8dfa51d392e551e2e8f3bd829"
328
+ },
329
+ {
330
+ "id": "en_hw:images/train_002132.jpg",
331
+ "branch": "english",
332
+ "max_errors": [
333
+ 0.0,
334
+ 0.0
335
+ ],
336
+ "byte_exact": [
337
+ true,
338
+ true
339
+ ],
340
+ "numerical_pass": true,
341
+ "inference_seconds": 0.6412029340863228,
342
+ "file": "training-20.npz",
343
+ "sha256": "cf4faeb40f9af3377682aed08a688efad81832be59c47459065cbfe175bde70e"
344
+ },
345
+ {
346
+ "id": "en_hw:images/train_002132.jpg",
347
+ "branch": "character",
348
+ "max_errors": [
349
+ 0.0,
350
+ 0.0
351
+ ],
352
+ "byte_exact": [
353
+ true,
354
+ true
355
+ ],
356
+ "numerical_pass": true,
357
+ "inference_seconds": 0.7008441369980574,
358
+ "file": "training-21.npz",
359
+ "sha256": "a37a7bdea06fd6e5790e2fefa8c9376ac91e7ae73ab6462ff16033a6ba49b0bf"
360
+ },
361
+ {
362
+ "id": "en_hw:images/train_001877.jpg",
363
+ "branch": "english",
364
+ "max_errors": [
365
+ 0.0,
366
+ 0.0
367
+ ],
368
+ "byte_exact": [
369
+ true,
370
+ true
371
+ ],
372
+ "numerical_pass": true,
373
+ "inference_seconds": 0.705221377313137,
374
+ "file": "training-22.npz",
375
+ "sha256": "bb4ce80d04227d3cac548e715b220783ce5bbf7323ec4501e500d91d75d01018"
376
+ },
377
+ {
378
+ "id": "en_hw:images/train_001877.jpg",
379
+ "branch": "character",
380
+ "max_errors": [
381
+ 0.0,
382
+ 0.0
383
+ ],
384
+ "byte_exact": [
385
+ true,
386
+ true
387
+ ],
388
+ "numerical_pass": true,
389
+ "inference_seconds": 0.6301882974803448,
390
+ "file": "training-23.npz",
391
+ "sha256": "e22b987cd122575465db84b22bfc0faadf8153b82f138f3967dcd5fccc491f6b"
392
+ }
393
+ ],
394
+ "numerical_limit": 0.0001,
395
+ "encoder_numerical_pass": true,
396
+ "graph_sha256": {
397
+ "encoder.json": "eddaf1699760460ba7f2bd7fbdee9b7de9166b581e5145d9dc3c8da177bd72b7",
398
+ "encoder.pdiparams": "b2a632ecd78bd35441f0575b5073ebdfe2dd8edebff08c892b386205655700b0"
399
+ },
400
+ "decoder_qualified": false,
401
+ "generation_qualified": false,
402
+ "quality_measured": false,
403
+ "native_Paddle_qualified": false,
404
+ "model_promoted": false,
405
+ "feature_controls": [],
406
+ "pooled_features_exposed": false,
407
+ "additional_learned_feature_parameters": 0
408
+ }
paddle/encoder/run.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "scope": "Export one actual conditional Paddle encoder and check all24 source fixtures.\n\nCount every saved neural value, including conditional factors. No source tensor\ninjection, separate full encoder, decoder, beam generation or quality claim.\nThe unchanged1e-4 bound applies to both branches; failure never changes it.\n",
3
+ "PID": 722385,
4
+ "proc_starttime": "1579109973",
5
+ "bundle_identity": {
6
+ "candidate_manifest_sha256": "0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede",
7
+ "weights_sha256": "9b58d252978d3a5d33adcdaea95e113162daf5146e20a9e1b8aa47e21e48ed93",
8
+ "trained_bundle": true,
9
+ "control_weights": false,
10
+ "source_sha256": {
11
+ "audit_shared_character_training.py": "3eccbe9b38f6c4aa255ac96d5bbe3229631cf0d1eb9b9a0ee1a6665e5b52b323",
12
+ "character_handwriting_curriculum.py": "ac6aeac728da7c20e1d5a16248aca81f5522d6614629b07052679d288259e53e",
13
+ "shared_character_recognizer.py": "0498d8b7d61f3c8e4a4fdcd927a507464cfaf8156bf874a211484a5474697719",
14
+ "shared_character_training.py": "b0991c9fd0da42c736c4d5b36f9b64f23c9be94303a259867402e8e4cfd42012",
15
+ "shared_private_protocol.py": "49384fcd48140482e0efc9a190c56878dc8d6d367f3d85aa843f948a269152b1",
16
+ "train_shared_character_private.py": "d50a1ea8f2f13fefe2f3a5166ddc417aee4c42c2da1ef2ff90c2602d5788fc3a",
17
+ "training_checkpoint.py": "569a4ca5b0a81b29f678e066e8bfa5bd337fcc2785bbc4b5d0dfd3e8dea7a051",
18
+ "trocr_character_codec.py": "7ede21e57fd4985153570820873abf690cc48de2e677b38828753fbedfdbd5e2",
19
+ "trocr_training_loss.py": "cb722cf44ef61f883f0e932763fe5566ecbab1d05a4f69ad68e466334d188f86"
20
+ },
21
+ "weight_verification_sha256": "693a3c2542b1a0284fd3967827dbbb77621e0d155ac62f32f00f2eb3a623f2de"
22
+ },
23
+ "candidate_manifest_sha256": "0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede",
24
+ "controls_sha256": "31f8b5ec579311d64b6ebfbd1f8e63e076c3565d9f12609398c76a096041b30e",
25
+ "parameters_by_graph": {
26
+ "encoder": 30432384,
27
+ "english_decoder": 38453760,
28
+ "character_decoder": 5956608
29
+ },
30
+ "whole_candidate_parameters": 74842752,
31
+ "numerical_limit": 0.0001,
32
+ "source_sha256": {
33
+ "audit_shared_character_paddle_encoder.py": "69f730d2e5fa581c93d8ccc5c02b5ef79843bf0dffe6fb2d27f689c53348bbff",
34
+ "shared_character_paddle.py": "d3947e59ada6971a8ce03a40d94886bd188e147a36872ca255798e4974dc3521",
35
+ "trocr_paddle_graphs.py": "13422f5004d84084e02dcf5d7fbc17623e9d17f6e7d67be256c5a05b122a880b",
36
+ "trocr_paddle_compact_encoder.py": "f2298a4e5cae283d72efd709e237bc71fcffd527dbc08a709bc599ade9aaea85",
37
+ "trocr_paddle_source_order_encoder.py": "aa937bb6ba67fd86e6214aa3a0be626e88a0c469a121ad4e9b1f6d250d704737",
38
+ "trocr_paddle_norm_probe.py": "e991a2a36ac6f89f05906c3635037caa2666ad5cbbc48db9396747abe4ba526f",
39
+ "trocr_paddle_sleef_probe.py": "14dcf8341e6bba8ad98eb1381dd6628d961bd4499ca5b1595f0153a9ab37d97c",
40
+ "trocr_paddle_attention_probe.py": "c7405bb5602c4cde7f1a3c5c53a7e2fced0e2e2064cdb78911cdcfff1e66e06f",
41
+ "trocr_source_cpu_ops.cc": "63bb541df8f7a1f8635c946f2407aa0f449e63cfe480cbbe6c0b8d6fb2f5f4c2",
42
+ "trocr_selective_onednn_pass.cc": "ff304ef7e20f22cc1bf3c3199c6614bc3e870db640e569d465ca87c6704051b6",
43
+ "shared_bundle_identity.py": "e696082c61d0f1e3dfc76130e3496d9964a517e2097b7cd15525de9cb267660f"
44
+ },
45
+ "Paddle": "3.3.1",
46
+ "CPU_affinity": [
47
+ 0,
48
+ 1
49
+ ],
50
+ "custom_passes": [
51
+ "ocr_conv_gelu_onednn_v1"
52
+ ],
53
+ "GPU_supported": false,
54
+ "expose_features": false
55
+ }
paddle/inference.yml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Global:
2
+ model_name: TrOCR_shared_character_Paddle_research_rec
3
+ Native:
4
+ format: shared-character-paddle-research-v1
5
+ parameters: 74842752
6
+ files_sha256:
7
+ candidate/bundle.json: 0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede
8
+ candidate/character-assets/character_codec.json: 7bb65c86bc29b555f8da3af81b7023e370bdebe6ced8c84d104d55165c6ffb0a
9
+ candidate/character-assets/preprocessor_config.json: 36a945a7cc645688b9ef64dabae16979cf5f7c1c448569cc306694edc0598b9b
10
+ candidate/english-assets/sentencepiece.bpe.model: 6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4
11
+ candidate/english-assets/tokenizer_config.json: e098c98c6834fbcd3f3e75215e3e8b8868f0fe5bf07aef93d28e4f7196db293c
12
+ candidate/english-assets/preprocessor_config.json: eec0c686d2e2ea6d5887f87e1c6a34ef5bf1ba5b2ac98b8675e131da646fa1d2
13
+ candidate/english-assets/README.md: 7e0f183a2697956065aea4e3ec9ca718967be1b7afe446cff4dcdbc8a64fa52b
14
+ encoder/encoder.json: eddaf1699760460ba7f2bd7fbdee9b7de9166b581e5145d9dc3c8da177bd72b7
15
+ encoder/encoder.pdiparams: b2a632ecd78bd35441f0575b5073ebdfe2dd8edebff08c892b386205655700b0
16
+ encoder/report.json: 6e19e7fe532e7d24d504f9e323e08d5c77e1ca07ceaeb1ebcc0f616369834dbc
17
+ encoder/run.json: 42c4cf89a86fc3de900949348079f7b0c90d4e58ca2d28a105e326785a3eacd5
18
+ decoders/report.json: 24a40b59ddedd55f423035cb40def1e251633948a67802707d14cf3151a67ba8
19
+ decoders/english/decoder-step.json: eaea1b3b5001549a6d0a4c4b1bd810371a82bdae2092452ac2f73214762ede95
20
+ decoders/english/decoder-step.pdiparams: ec5ec71ad13c5305a1a95c8c2846c4de526571e58ce8df00fa5dbac529940a16
21
+ decoders/character/decoder-step.json: 555d79e651df3b22fef37f7cc873c843678c135bbe39e69488f4ef3b2acb3e5d
22
+ decoders/character/decoder-step.pdiparams: e35ba8d8743abdcf8b6cdb48a572a669cbf3e504d38d2a48827b68657e32aeff
23
+ encoder-library.so: fce69529c6a3752247be1192a495de7d1c395f8493039ad0d17546a42f936c60
24
+ code/paddlex_shared_character.py: 6a7b1d60aa337ba04514c9910e68f96d1bafdff383f3779e83f22a587707a3e3
25
+ code/shared_character_native.py: 394b45df79c5c4e84c2053b62b8d4080ef6a875034b6b16c661ac63257f56a30
26
+ code/trocr_character_codec.py: 7ede21e57fd4985153570820873abf690cc48de2e677b38828753fbedfdbd5e2
27
+ code/trocr_numpy_beam.py: e4f1d87113404dfc16fdddd78a1cdd6477a2f886d76cef99594fc537fc531028
28
+ code/trocr_source_cpu_ops.cc: 63bb541df8f7a1f8635c946f2407aa0f449e63cfe480cbbe6c0b8d6fb2f5f4c2
29
+ code/trocr_selective_onednn_pass.cc: ff304ef7e20f22cc1bf3c3199c6614bc3e870db640e569d465ca87c6704051b6
30
+ code/trocr_paddle_norm_probe.LICENSE: 19d6a3818fa4927890b59222656f155faae8f8817ebc9f40f779fdb6ab5a65d2
31
+ code/trocr_paddle_sleef_probe.LICENSE: 5f35cc826b3a0001293ed62e8ea95e5784f89f5e25300bf437d34be1d35e8a75
32
+ code/trocr_selective_onednn_pass.LICENSE: ff6311c56c1b22c9209c96cc8afc16da91c24ee55a15e14ebc46fe1960dbd856
33
+ profile: CPU two threads, FMA, Paddle3.3.1; explicit branch; research only
predict.py ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Recognize one cropped word or line with an explicit language branch."""
2
+ import argparse
3
+ import json
4
+ from pathlib import Path
5
+ import sys
6
+
7
+
8
+ def main():
9
+ parser = argparse.ArgumentParser(description=__doc__)
10
+ parser.add_argument('image', type=Path)
11
+ parser.add_argument('--language', choices=['ne', 'hi', 'en'], required=True)
12
+ parser.add_argument('--backend', choices=['torch', 'paddle'], default='torch')
13
+ parser.add_argument('--model-dir', type=Path, default=Path(__file__).resolve().parent)
14
+ args = parser.parse_args()
15
+ root = args.model_dir.resolve()
16
+ branch = 'english' if args.language == 'en' else 'character'
17
+ if args.backend == 'torch':
18
+ import torch
19
+ from PIL import Image
20
+ from transformers import TrOCRProcessor, ViTImageProcessor
21
+ sys.path.insert(0, str(root / 'code'))
22
+ from shared_character_recognizer import SharedCharacterRecognizer
23
+ from trocr_character_codec import CharacterCodec
24
+ torch.set_num_threads(2)
25
+ torch.use_deterministic_algorithms(True)
26
+ folder = root / 'source-model'
27
+ model = SharedCharacterRecognizer.from_bundle(folder)
28
+ assets = folder / ('english-assets' if branch == 'english' else 'character-assets')
29
+ processor = (TrOCRProcessor.from_pretrained(assets, local_files_only=True, use_fast=False)
30
+ if branch == 'english' else ViTImageProcessor.from_pretrained(assets, local_files_only=True))
31
+ with Image.open(args.image) as image:
32
+ pixels = processor(images=image.convert('RGB'), return_tensors='pt').pixel_values
33
+ generation = dict(do_sample=False, num_beams=10, max_new_tokens=256 if branch == 'english' else 257,
34
+ min_length=0, length_penalty=1., early_stopping=False, use_cache=True)
35
+ if branch == 'character':
36
+ generation['suppress_tokens'] = [0, 1, 3]
37
+ with torch.inference_mode():
38
+ tokens = model.generate_pixels(pixels, branch, generation)[0].tolist()
39
+ if branch == 'english':
40
+ text = processor.batch_decode([tokens], skip_special_tokens=True)[0]
41
+ else:
42
+ spec = json.loads((assets / 'character_codec.json').read_text())
43
+ text = CharacterCodec(list(spec['character_ids'])).decode(tokens)
44
+ result = dict(text=text, tokens=tokens, token_limit_reached=len(tokens)-1 >= generation['max_new_tokens'] and tokens[-1] != 2)
45
+ else:
46
+ import paddle
47
+ from PIL import Image
48
+ sys.path.insert(0, str(root / 'paddle/code'))
49
+ from shared_character_native import SharedCharacterNative, preprocess_rgb
50
+ paddle.set_device('cpu')
51
+ folder = root / 'paddle'
52
+ model = SharedCharacterNative(folder / 'candidate', folder / 'encoder', folder / 'decoders',
53
+ allow_unqualified=True, library_path=folder / 'encoder-library.so')
54
+ with Image.open(args.image) as image:
55
+ result = model.predict_pixels(preprocess_rgb(image), branch)
56
+ print(json.dumps(dict(language=args.language, branch=branch, backend=args.backend, **result), ensure_ascii=False))
57
+
58
+
59
+ if __name__ == '__main__':
60
+ main()
release-manifest.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_id": "ampixa/deva-ocr-75m-research",
3
+ "candidate_manifest_sha256": "0510d21cd0bb7a249dafac167fd2e371ee63bd6f83a016a6c4f2e7c6bb843ede",
4
+ "source_weights_sha256": "9b58d252978d3a5d33adcdaea95e113162daf5146e20a9e1b8aa47e21e48ed93",
5
+ "physical_neural_values": 74842752,
6
+ "source_model_format": "shared-character-private-continuation-source-v1",
7
+ "training_step": 8000,
8
+ "cumulative_training_step": 16000,
9
+ "original_native_bundle_sha256": "7f4091be58fc6398363d7a192fab73af6832a543a193efada11b91f188e7d120",
10
+ "native_graph_parameters_unchanged": true,
11
+ "complete_preexisting_native_source_comparison_images": 8796,
12
+ "packaged_conversion_predictions": false,
13
+ "packaged_training_data": false,
14
+ "published_use_scope": "non-commercial research and education; see LICENSE and TRAINING_DATA.md"
15
+ }
requirements-paddle.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ paddlepaddle==3.3.1
2
+ paddlex==3.7.1
3
+ sentencepiece==0.2.1
4
+ tokenizers==0.22.2
5
+ Pillow>=10.4
6
+ numpy>=2.0
7
+ PyYAML>=6
requirements-source.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ torch>=2.6
2
+ transformers==4.57.6
3
+ safetensors>=0.6
4
+ sentencepiece==0.2.1
5
+ Pillow>=10.4
6
+ numpy>=1.26
source-model/bundle.json ADDED
@@ -0,0 +1,2075 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format": "shared-character-private-continuation-source-v1",
3
+ "parameters": 74842752,
4
+ "corrections": [
5
+ {
6
+ "key": "t000",
7
+ "name": "embeddings.cls_token",
8
+ "shape": [
9
+ 1,
10
+ 1,
11
+ 384
12
+ ],
13
+ "kind": "replacement"
14
+ },
15
+ {
16
+ "key": "t001",
17
+ "name": "embeddings.distillation_token",
18
+ "shape": [
19
+ 1,
20
+ 1,
21
+ 384
22
+ ],
23
+ "kind": "replacement"
24
+ },
25
+ {
26
+ "key": "t002",
27
+ "name": "embeddings.patch_embeddings.projection.bias",
28
+ "shape": [
29
+ 384
30
+ ],
31
+ "kind": "replacement"
32
+ },
33
+ {
34
+ "key": "t003",
35
+ "name": "embeddings.patch_embeddings.projection.weight",
36
+ "shape": [
37
+ 384,
38
+ 3,
39
+ 16,
40
+ 16
41
+ ],
42
+ "kind": "factor",
43
+ "rank": 71,
44
+ "matrix_shape": [
45
+ 384,
46
+ 768
47
+ ]
48
+ },
49
+ {
50
+ "key": "t004",
51
+ "name": "embeddings.position_embeddings",
52
+ "shape": [
53
+ 1,
54
+ 578,
55
+ 384
56
+ ],
57
+ "kind": "replacement"
58
+ },
59
+ {
60
+ "key": "t005",
61
+ "name": "encoder.layer.0.attention.attention.key.bias",
62
+ "shape": [
63
+ 384
64
+ ],
65
+ "kind": "replacement"
66
+ },
67
+ {
68
+ "key": "t006",
69
+ "name": "encoder.layer.0.attention.attention.key.weight",
70
+ "shape": [
71
+ 384,
72
+ 384
73
+ ],
74
+ "kind": "factor",
75
+ "rank": 71,
76
+ "matrix_shape": [
77
+ 384,
78
+ 384
79
+ ]
80
+ },
81
+ {
82
+ "key": "t007",
83
+ "name": "encoder.layer.0.attention.attention.query.bias",
84
+ "shape": [
85
+ 384
86
+ ],
87
+ "kind": "replacement"
88
+ },
89
+ {
90
+ "key": "t008",
91
+ "name": "encoder.layer.0.attention.attention.query.weight",
92
+ "shape": [
93
+ 384,
94
+ 384
95
+ ],
96
+ "kind": "factor",
97
+ "rank": 71,
98
+ "matrix_shape": [
99
+ 384,
100
+ 384
101
+ ]
102
+ },
103
+ {
104
+ "key": "t009",
105
+ "name": "encoder.layer.0.attention.attention.value.bias",
106
+ "shape": [
107
+ 384
108
+ ],
109
+ "kind": "replacement"
110
+ },
111
+ {
112
+ "key": "t010",
113
+ "name": "encoder.layer.0.attention.attention.value.weight",
114
+ "shape": [
115
+ 384,
116
+ 384
117
+ ],
118
+ "kind": "factor",
119
+ "rank": 71,
120
+ "matrix_shape": [
121
+ 384,
122
+ 384
123
+ ]
124
+ },
125
+ {
126
+ "key": "t011",
127
+ "name": "encoder.layer.0.attention.output.dense.bias",
128
+ "shape": [
129
+ 384
130
+ ],
131
+ "kind": "replacement"
132
+ },
133
+ {
134
+ "key": "t012",
135
+ "name": "encoder.layer.0.attention.output.dense.weight",
136
+ "shape": [
137
+ 384,
138
+ 384
139
+ ],
140
+ "kind": "factor",
141
+ "rank": 71,
142
+ "matrix_shape": [
143
+ 384,
144
+ 384
145
+ ]
146
+ },
147
+ {
148
+ "key": "t013",
149
+ "name": "encoder.layer.0.intermediate.dense.bias",
150
+ "shape": [
151
+ 1536
152
+ ],
153
+ "kind": "replacement"
154
+ },
155
+ {
156
+ "key": "t014",
157
+ "name": "encoder.layer.0.intermediate.dense.weight",
158
+ "shape": [
159
+ 1536,
160
+ 384
161
+ ],
162
+ "kind": "factor",
163
+ "rank": 71,
164
+ "matrix_shape": [
165
+ 1536,
166
+ 384
167
+ ]
168
+ },
169
+ {
170
+ "key": "t015",
171
+ "name": "encoder.layer.0.layernorm_after.bias",
172
+ "shape": [
173
+ 384
174
+ ],
175
+ "kind": "replacement"
176
+ },
177
+ {
178
+ "key": "t016",
179
+ "name": "encoder.layer.0.layernorm_after.weight",
180
+ "shape": [
181
+ 384
182
+ ],
183
+ "kind": "replacement"
184
+ },
185
+ {
186
+ "key": "t017",
187
+ "name": "encoder.layer.0.layernorm_before.bias",
188
+ "shape": [
189
+ 384
190
+ ],
191
+ "kind": "replacement"
192
+ },
193
+ {
194
+ "key": "t018",
195
+ "name": "encoder.layer.0.layernorm_before.weight",
196
+ "shape": [
197
+ 384
198
+ ],
199
+ "kind": "replacement"
200
+ },
201
+ {
202
+ "key": "t019",
203
+ "name": "encoder.layer.0.output.dense.bias",
204
+ "shape": [
205
+ 384
206
+ ],
207
+ "kind": "replacement"
208
+ },
209
+ {
210
+ "key": "t020",
211
+ "name": "encoder.layer.0.output.dense.weight",
212
+ "shape": [
213
+ 384,
214
+ 1536
215
+ ],
216
+ "kind": "factor",
217
+ "rank": 71,
218
+ "matrix_shape": [
219
+ 384,
220
+ 1536
221
+ ]
222
+ },
223
+ {
224
+ "key": "t021",
225
+ "name": "encoder.layer.1.attention.attention.key.bias",
226
+ "shape": [
227
+ 384
228
+ ],
229
+ "kind": "replacement"
230
+ },
231
+ {
232
+ "key": "t022",
233
+ "name": "encoder.layer.1.attention.attention.key.weight",
234
+ "shape": [
235
+ 384,
236
+ 384
237
+ ],
238
+ "kind": "factor",
239
+ "rank": 71,
240
+ "matrix_shape": [
241
+ 384,
242
+ 384
243
+ ]
244
+ },
245
+ {
246
+ "key": "t023",
247
+ "name": "encoder.layer.1.attention.attention.query.bias",
248
+ "shape": [
249
+ 384
250
+ ],
251
+ "kind": "replacement"
252
+ },
253
+ {
254
+ "key": "t024",
255
+ "name": "encoder.layer.1.attention.attention.query.weight",
256
+ "shape": [
257
+ 384,
258
+ 384
259
+ ],
260
+ "kind": "factor",
261
+ "rank": 71,
262
+ "matrix_shape": [
263
+ 384,
264
+ 384
265
+ ]
266
+ },
267
+ {
268
+ "key": "t025",
269
+ "name": "encoder.layer.1.attention.attention.value.bias",
270
+ "shape": [
271
+ 384
272
+ ],
273
+ "kind": "replacement"
274
+ },
275
+ {
276
+ "key": "t026",
277
+ "name": "encoder.layer.1.attention.attention.value.weight",
278
+ "shape": [
279
+ 384,
280
+ 384
281
+ ],
282
+ "kind": "factor",
283
+ "rank": 71,
284
+ "matrix_shape": [
285
+ 384,
286
+ 384
287
+ ]
288
+ },
289
+ {
290
+ "key": "t027",
291
+ "name": "encoder.layer.1.attention.output.dense.bias",
292
+ "shape": [
293
+ 384
294
+ ],
295
+ "kind": "replacement"
296
+ },
297
+ {
298
+ "key": "t028",
299
+ "name": "encoder.layer.1.attention.output.dense.weight",
300
+ "shape": [
301
+ 384,
302
+ 384
303
+ ],
304
+ "kind": "factor",
305
+ "rank": 71,
306
+ "matrix_shape": [
307
+ 384,
308
+ 384
309
+ ]
310
+ },
311
+ {
312
+ "key": "t029",
313
+ "name": "encoder.layer.1.intermediate.dense.bias",
314
+ "shape": [
315
+ 1536
316
+ ],
317
+ "kind": "replacement"
318
+ },
319
+ {
320
+ "key": "t030",
321
+ "name": "encoder.layer.1.intermediate.dense.weight",
322
+ "shape": [
323
+ 1536,
324
+ 384
325
+ ],
326
+ "kind": "factor",
327
+ "rank": 71,
328
+ "matrix_shape": [
329
+ 1536,
330
+ 384
331
+ ]
332
+ },
333
+ {
334
+ "key": "t031",
335
+ "name": "encoder.layer.1.layernorm_after.bias",
336
+ "shape": [
337
+ 384
338
+ ],
339
+ "kind": "replacement"
340
+ },
341
+ {
342
+ "key": "t032",
343
+ "name": "encoder.layer.1.layernorm_after.weight",
344
+ "shape": [
345
+ 384
346
+ ],
347
+ "kind": "replacement"
348
+ },
349
+ {
350
+ "key": "t033",
351
+ "name": "encoder.layer.1.layernorm_before.bias",
352
+ "shape": [
353
+ 384
354
+ ],
355
+ "kind": "replacement"
356
+ },
357
+ {
358
+ "key": "t034",
359
+ "name": "encoder.layer.1.layernorm_before.weight",
360
+ "shape": [
361
+ 384
362
+ ],
363
+ "kind": "replacement"
364
+ },
365
+ {
366
+ "key": "t035",
367
+ "name": "encoder.layer.1.output.dense.bias",
368
+ "shape": [
369
+ 384
370
+ ],
371
+ "kind": "replacement"
372
+ },
373
+ {
374
+ "key": "t036",
375
+ "name": "encoder.layer.1.output.dense.weight",
376
+ "shape": [
377
+ 384,
378
+ 1536
379
+ ],
380
+ "kind": "factor",
381
+ "rank": 71,
382
+ "matrix_shape": [
383
+ 384,
384
+ 1536
385
+ ]
386
+ },
387
+ {
388
+ "key": "t037",
389
+ "name": "encoder.layer.10.attention.attention.key.bias",
390
+ "shape": [
391
+ 384
392
+ ],
393
+ "kind": "replacement"
394
+ },
395
+ {
396
+ "key": "t038",
397
+ "name": "encoder.layer.10.attention.attention.key.weight",
398
+ "shape": [
399
+ 384,
400
+ 384
401
+ ],
402
+ "kind": "factor",
403
+ "rank": 71,
404
+ "matrix_shape": [
405
+ 384,
406
+ 384
407
+ ]
408
+ },
409
+ {
410
+ "key": "t039",
411
+ "name": "encoder.layer.10.attention.attention.query.bias",
412
+ "shape": [
413
+ 384
414
+ ],
415
+ "kind": "replacement"
416
+ },
417
+ {
418
+ "key": "t040",
419
+ "name": "encoder.layer.10.attention.attention.query.weight",
420
+ "shape": [
421
+ 384,
422
+ 384
423
+ ],
424
+ "kind": "factor",
425
+ "rank": 71,
426
+ "matrix_shape": [
427
+ 384,
428
+ 384
429
+ ]
430
+ },
431
+ {
432
+ "key": "t041",
433
+ "name": "encoder.layer.10.attention.attention.value.bias",
434
+ "shape": [
435
+ 384
436
+ ],
437
+ "kind": "replacement"
438
+ },
439
+ {
440
+ "key": "t042",
441
+ "name": "encoder.layer.10.attention.attention.value.weight",
442
+ "shape": [
443
+ 384,
444
+ 384
445
+ ],
446
+ "kind": "factor",
447
+ "rank": 71,
448
+ "matrix_shape": [
449
+ 384,
450
+ 384
451
+ ]
452
+ },
453
+ {
454
+ "key": "t043",
455
+ "name": "encoder.layer.10.attention.output.dense.bias",
456
+ "shape": [
457
+ 384
458
+ ],
459
+ "kind": "replacement"
460
+ },
461
+ {
462
+ "key": "t044",
463
+ "name": "encoder.layer.10.attention.output.dense.weight",
464
+ "shape": [
465
+ 384,
466
+ 384
467
+ ],
468
+ "kind": "factor",
469
+ "rank": 71,
470
+ "matrix_shape": [
471
+ 384,
472
+ 384
473
+ ]
474
+ },
475
+ {
476
+ "key": "t045",
477
+ "name": "encoder.layer.10.intermediate.dense.bias",
478
+ "shape": [
479
+ 1536
480
+ ],
481
+ "kind": "replacement"
482
+ },
483
+ {
484
+ "key": "t046",
485
+ "name": "encoder.layer.10.intermediate.dense.weight",
486
+ "shape": [
487
+ 1536,
488
+ 384
489
+ ],
490
+ "kind": "factor",
491
+ "rank": 71,
492
+ "matrix_shape": [
493
+ 1536,
494
+ 384
495
+ ]
496
+ },
497
+ {
498
+ "key": "t047",
499
+ "name": "encoder.layer.10.layernorm_after.bias",
500
+ "shape": [
501
+ 384
502
+ ],
503
+ "kind": "replacement"
504
+ },
505
+ {
506
+ "key": "t048",
507
+ "name": "encoder.layer.10.layernorm_after.weight",
508
+ "shape": [
509
+ 384
510
+ ],
511
+ "kind": "replacement"
512
+ },
513
+ {
514
+ "key": "t049",
515
+ "name": "encoder.layer.10.layernorm_before.bias",
516
+ "shape": [
517
+ 384
518
+ ],
519
+ "kind": "replacement"
520
+ },
521
+ {
522
+ "key": "t050",
523
+ "name": "encoder.layer.10.layernorm_before.weight",
524
+ "shape": [
525
+ 384
526
+ ],
527
+ "kind": "replacement"
528
+ },
529
+ {
530
+ "key": "t051",
531
+ "name": "encoder.layer.10.output.dense.bias",
532
+ "shape": [
533
+ 384
534
+ ],
535
+ "kind": "replacement"
536
+ },
537
+ {
538
+ "key": "t052",
539
+ "name": "encoder.layer.10.output.dense.weight",
540
+ "shape": [
541
+ 384,
542
+ 1536
543
+ ],
544
+ "kind": "factor",
545
+ "rank": 71,
546
+ "matrix_shape": [
547
+ 384,
548
+ 1536
549
+ ]
550
+ },
551
+ {
552
+ "key": "t053",
553
+ "name": "encoder.layer.11.attention.attention.key.bias",
554
+ "shape": [
555
+ 384
556
+ ],
557
+ "kind": "replacement"
558
+ },
559
+ {
560
+ "key": "t054",
561
+ "name": "encoder.layer.11.attention.attention.key.weight",
562
+ "shape": [
563
+ 384,
564
+ 384
565
+ ],
566
+ "kind": "factor",
567
+ "rank": 71,
568
+ "matrix_shape": [
569
+ 384,
570
+ 384
571
+ ]
572
+ },
573
+ {
574
+ "key": "t055",
575
+ "name": "encoder.layer.11.attention.attention.query.bias",
576
+ "shape": [
577
+ 384
578
+ ],
579
+ "kind": "replacement"
580
+ },
581
+ {
582
+ "key": "t056",
583
+ "name": "encoder.layer.11.attention.attention.query.weight",
584
+ "shape": [
585
+ 384,
586
+ 384
587
+ ],
588
+ "kind": "factor",
589
+ "rank": 71,
590
+ "matrix_shape": [
591
+ 384,
592
+ 384
593
+ ]
594
+ },
595
+ {
596
+ "key": "t057",
597
+ "name": "encoder.layer.11.attention.attention.value.bias",
598
+ "shape": [
599
+ 384
600
+ ],
601
+ "kind": "replacement"
602
+ },
603
+ {
604
+ "key": "t058",
605
+ "name": "encoder.layer.11.attention.attention.value.weight",
606
+ "shape": [
607
+ 384,
608
+ 384
609
+ ],
610
+ "kind": "factor",
611
+ "rank": 71,
612
+ "matrix_shape": [
613
+ 384,
614
+ 384
615
+ ]
616
+ },
617
+ {
618
+ "key": "t059",
619
+ "name": "encoder.layer.11.attention.output.dense.bias",
620
+ "shape": [
621
+ 384
622
+ ],
623
+ "kind": "replacement"
624
+ },
625
+ {
626
+ "key": "t060",
627
+ "name": "encoder.layer.11.attention.output.dense.weight",
628
+ "shape": [
629
+ 384,
630
+ 384
631
+ ],
632
+ "kind": "factor",
633
+ "rank": 71,
634
+ "matrix_shape": [
635
+ 384,
636
+ 384
637
+ ]
638
+ },
639
+ {
640
+ "key": "t061",
641
+ "name": "encoder.layer.11.intermediate.dense.bias",
642
+ "shape": [
643
+ 1536
644
+ ],
645
+ "kind": "replacement"
646
+ },
647
+ {
648
+ "key": "t062",
649
+ "name": "encoder.layer.11.intermediate.dense.weight",
650
+ "shape": [
651
+ 1536,
652
+ 384
653
+ ],
654
+ "kind": "factor",
655
+ "rank": 71,
656
+ "matrix_shape": [
657
+ 1536,
658
+ 384
659
+ ]
660
+ },
661
+ {
662
+ "key": "t063",
663
+ "name": "encoder.layer.11.layernorm_after.bias",
664
+ "shape": [
665
+ 384
666
+ ],
667
+ "kind": "replacement"
668
+ },
669
+ {
670
+ "key": "t064",
671
+ "name": "encoder.layer.11.layernorm_after.weight",
672
+ "shape": [
673
+ 384
674
+ ],
675
+ "kind": "replacement"
676
+ },
677
+ {
678
+ "key": "t065",
679
+ "name": "encoder.layer.11.layernorm_before.bias",
680
+ "shape": [
681
+ 384
682
+ ],
683
+ "kind": "replacement"
684
+ },
685
+ {
686
+ "key": "t066",
687
+ "name": "encoder.layer.11.layernorm_before.weight",
688
+ "shape": [
689
+ 384
690
+ ],
691
+ "kind": "replacement"
692
+ },
693
+ {
694
+ "key": "t067",
695
+ "name": "encoder.layer.11.output.dense.bias",
696
+ "shape": [
697
+ 384
698
+ ],
699
+ "kind": "replacement"
700
+ },
701
+ {
702
+ "key": "t068",
703
+ "name": "encoder.layer.11.output.dense.weight",
704
+ "shape": [
705
+ 384,
706
+ 1536
707
+ ],
708
+ "kind": "factor",
709
+ "rank": 71,
710
+ "matrix_shape": [
711
+ 384,
712
+ 1536
713
+ ]
714
+ },
715
+ {
716
+ "key": "t069",
717
+ "name": "encoder.layer.2.attention.attention.key.bias",
718
+ "shape": [
719
+ 384
720
+ ],
721
+ "kind": "replacement"
722
+ },
723
+ {
724
+ "key": "t070",
725
+ "name": "encoder.layer.2.attention.attention.key.weight",
726
+ "shape": [
727
+ 384,
728
+ 384
729
+ ],
730
+ "kind": "factor",
731
+ "rank": 71,
732
+ "matrix_shape": [
733
+ 384,
734
+ 384
735
+ ]
736
+ },
737
+ {
738
+ "key": "t071",
739
+ "name": "encoder.layer.2.attention.attention.query.bias",
740
+ "shape": [
741
+ 384
742
+ ],
743
+ "kind": "replacement"
744
+ },
745
+ {
746
+ "key": "t072",
747
+ "name": "encoder.layer.2.attention.attention.query.weight",
748
+ "shape": [
749
+ 384,
750
+ 384
751
+ ],
752
+ "kind": "factor",
753
+ "rank": 71,
754
+ "matrix_shape": [
755
+ 384,
756
+ 384
757
+ ]
758
+ },
759
+ {
760
+ "key": "t073",
761
+ "name": "encoder.layer.2.attention.attention.value.bias",
762
+ "shape": [
763
+ 384
764
+ ],
765
+ "kind": "replacement"
766
+ },
767
+ {
768
+ "key": "t074",
769
+ "name": "encoder.layer.2.attention.attention.value.weight",
770
+ "shape": [
771
+ 384,
772
+ 384
773
+ ],
774
+ "kind": "factor",
775
+ "rank": 71,
776
+ "matrix_shape": [
777
+ 384,
778
+ 384
779
+ ]
780
+ },
781
+ {
782
+ "key": "t075",
783
+ "name": "encoder.layer.2.attention.output.dense.bias",
784
+ "shape": [
785
+ 384
786
+ ],
787
+ "kind": "replacement"
788
+ },
789
+ {
790
+ "key": "t076",
791
+ "name": "encoder.layer.2.attention.output.dense.weight",
792
+ "shape": [
793
+ 384,
794
+ 384
795
+ ],
796
+ "kind": "factor",
797
+ "rank": 71,
798
+ "matrix_shape": [
799
+ 384,
800
+ 384
801
+ ]
802
+ },
803
+ {
804
+ "key": "t077",
805
+ "name": "encoder.layer.2.intermediate.dense.bias",
806
+ "shape": [
807
+ 1536
808
+ ],
809
+ "kind": "replacement"
810
+ },
811
+ {
812
+ "key": "t078",
813
+ "name": "encoder.layer.2.intermediate.dense.weight",
814
+ "shape": [
815
+ 1536,
816
+ 384
817
+ ],
818
+ "kind": "factor",
819
+ "rank": 71,
820
+ "matrix_shape": [
821
+ 1536,
822
+ 384
823
+ ]
824
+ },
825
+ {
826
+ "key": "t079",
827
+ "name": "encoder.layer.2.layernorm_after.bias",
828
+ "shape": [
829
+ 384
830
+ ],
831
+ "kind": "replacement"
832
+ },
833
+ {
834
+ "key": "t080",
835
+ "name": "encoder.layer.2.layernorm_after.weight",
836
+ "shape": [
837
+ 384
838
+ ],
839
+ "kind": "replacement"
840
+ },
841
+ {
842
+ "key": "t081",
843
+ "name": "encoder.layer.2.layernorm_before.bias",
844
+ "shape": [
845
+ 384
846
+ ],
847
+ "kind": "replacement"
848
+ },
849
+ {
850
+ "key": "t082",
851
+ "name": "encoder.layer.2.layernorm_before.weight",
852
+ "shape": [
853
+ 384
854
+ ],
855
+ "kind": "replacement"
856
+ },
857
+ {
858
+ "key": "t083",
859
+ "name": "encoder.layer.2.output.dense.bias",
860
+ "shape": [
861
+ 384
862
+ ],
863
+ "kind": "replacement"
864
+ },
865
+ {
866
+ "key": "t084",
867
+ "name": "encoder.layer.2.output.dense.weight",
868
+ "shape": [
869
+ 384,
870
+ 1536
871
+ ],
872
+ "kind": "factor",
873
+ "rank": 71,
874
+ "matrix_shape": [
875
+ 384,
876
+ 1536
877
+ ]
878
+ },
879
+ {
880
+ "key": "t085",
881
+ "name": "encoder.layer.3.attention.attention.key.bias",
882
+ "shape": [
883
+ 384
884
+ ],
885
+ "kind": "replacement"
886
+ },
887
+ {
888
+ "key": "t086",
889
+ "name": "encoder.layer.3.attention.attention.key.weight",
890
+ "shape": [
891
+ 384,
892
+ 384
893
+ ],
894
+ "kind": "factor",
895
+ "rank": 71,
896
+ "matrix_shape": [
897
+ 384,
898
+ 384
899
+ ]
900
+ },
901
+ {
902
+ "key": "t087",
903
+ "name": "encoder.layer.3.attention.attention.query.bias",
904
+ "shape": [
905
+ 384
906
+ ],
907
+ "kind": "replacement"
908
+ },
909
+ {
910
+ "key": "t088",
911
+ "name": "encoder.layer.3.attention.attention.query.weight",
912
+ "shape": [
913
+ 384,
914
+ 384
915
+ ],
916
+ "kind": "factor",
917
+ "rank": 71,
918
+ "matrix_shape": [
919
+ 384,
920
+ 384
921
+ ]
922
+ },
923
+ {
924
+ "key": "t089",
925
+ "name": "encoder.layer.3.attention.attention.value.bias",
926
+ "shape": [
927
+ 384
928
+ ],
929
+ "kind": "replacement"
930
+ },
931
+ {
932
+ "key": "t090",
933
+ "name": "encoder.layer.3.attention.attention.value.weight",
934
+ "shape": [
935
+ 384,
936
+ 384
937
+ ],
938
+ "kind": "factor",
939
+ "rank": 71,
940
+ "matrix_shape": [
941
+ 384,
942
+ 384
943
+ ]
944
+ },
945
+ {
946
+ "key": "t091",
947
+ "name": "encoder.layer.3.attention.output.dense.bias",
948
+ "shape": [
949
+ 384
950
+ ],
951
+ "kind": "replacement"
952
+ },
953
+ {
954
+ "key": "t092",
955
+ "name": "encoder.layer.3.attention.output.dense.weight",
956
+ "shape": [
957
+ 384,
958
+ 384
959
+ ],
960
+ "kind": "factor",
961
+ "rank": 71,
962
+ "matrix_shape": [
963
+ 384,
964
+ 384
965
+ ]
966
+ },
967
+ {
968
+ "key": "t093",
969
+ "name": "encoder.layer.3.intermediate.dense.bias",
970
+ "shape": [
971
+ 1536
972
+ ],
973
+ "kind": "replacement"
974
+ },
975
+ {
976
+ "key": "t094",
977
+ "name": "encoder.layer.3.intermediate.dense.weight",
978
+ "shape": [
979
+ 1536,
980
+ 384
981
+ ],
982
+ "kind": "factor",
983
+ "rank": 71,
984
+ "matrix_shape": [
985
+ 1536,
986
+ 384
987
+ ]
988
+ },
989
+ {
990
+ "key": "t095",
991
+ "name": "encoder.layer.3.layernorm_after.bias",
992
+ "shape": [
993
+ 384
994
+ ],
995
+ "kind": "replacement"
996
+ },
997
+ {
998
+ "key": "t096",
999
+ "name": "encoder.layer.3.layernorm_after.weight",
1000
+ "shape": [
1001
+ 384
1002
+ ],
1003
+ "kind": "replacement"
1004
+ },
1005
+ {
1006
+ "key": "t097",
1007
+ "name": "encoder.layer.3.layernorm_before.bias",
1008
+ "shape": [
1009
+ 384
1010
+ ],
1011
+ "kind": "replacement"
1012
+ },
1013
+ {
1014
+ "key": "t098",
1015
+ "name": "encoder.layer.3.layernorm_before.weight",
1016
+ "shape": [
1017
+ 384
1018
+ ],
1019
+ "kind": "replacement"
1020
+ },
1021
+ {
1022
+ "key": "t099",
1023
+ "name": "encoder.layer.3.output.dense.bias",
1024
+ "shape": [
1025
+ 384
1026
+ ],
1027
+ "kind": "replacement"
1028
+ },
1029
+ {
1030
+ "key": "t100",
1031
+ "name": "encoder.layer.3.output.dense.weight",
1032
+ "shape": [
1033
+ 384,
1034
+ 1536
1035
+ ],
1036
+ "kind": "factor",
1037
+ "rank": 71,
1038
+ "matrix_shape": [
1039
+ 384,
1040
+ 1536
1041
+ ]
1042
+ },
1043
+ {
1044
+ "key": "t101",
1045
+ "name": "encoder.layer.4.attention.attention.key.bias",
1046
+ "shape": [
1047
+ 384
1048
+ ],
1049
+ "kind": "replacement"
1050
+ },
1051
+ {
1052
+ "key": "t102",
1053
+ "name": "encoder.layer.4.attention.attention.key.weight",
1054
+ "shape": [
1055
+ 384,
1056
+ 384
1057
+ ],
1058
+ "kind": "factor",
1059
+ "rank": 71,
1060
+ "matrix_shape": [
1061
+ 384,
1062
+ 384
1063
+ ]
1064
+ },
1065
+ {
1066
+ "key": "t103",
1067
+ "name": "encoder.layer.4.attention.attention.query.bias",
1068
+ "shape": [
1069
+ 384
1070
+ ],
1071
+ "kind": "replacement"
1072
+ },
1073
+ {
1074
+ "key": "t104",
1075
+ "name": "encoder.layer.4.attention.attention.query.weight",
1076
+ "shape": [
1077
+ 384,
1078
+ 384
1079
+ ],
1080
+ "kind": "factor",
1081
+ "rank": 71,
1082
+ "matrix_shape": [
1083
+ 384,
1084
+ 384
1085
+ ]
1086
+ },
1087
+ {
1088
+ "key": "t105",
1089
+ "name": "encoder.layer.4.attention.attention.value.bias",
1090
+ "shape": [
1091
+ 384
1092
+ ],
1093
+ "kind": "replacement"
1094
+ },
1095
+ {
1096
+ "key": "t106",
1097
+ "name": "encoder.layer.4.attention.attention.value.weight",
1098
+ "shape": [
1099
+ 384,
1100
+ 384
1101
+ ],
1102
+ "kind": "factor",
1103
+ "rank": 71,
1104
+ "matrix_shape": [
1105
+ 384,
1106
+ 384
1107
+ ]
1108
+ },
1109
+ {
1110
+ "key": "t107",
1111
+ "name": "encoder.layer.4.attention.output.dense.bias",
1112
+ "shape": [
1113
+ 384
1114
+ ],
1115
+ "kind": "replacement"
1116
+ },
1117
+ {
1118
+ "key": "t108",
1119
+ "name": "encoder.layer.4.attention.output.dense.weight",
1120
+ "shape": [
1121
+ 384,
1122
+ 384
1123
+ ],
1124
+ "kind": "factor",
1125
+ "rank": 71,
1126
+ "matrix_shape": [
1127
+ 384,
1128
+ 384
1129
+ ]
1130
+ },
1131
+ {
1132
+ "key": "t109",
1133
+ "name": "encoder.layer.4.intermediate.dense.bias",
1134
+ "shape": [
1135
+ 1536
1136
+ ],
1137
+ "kind": "replacement"
1138
+ },
1139
+ {
1140
+ "key": "t110",
1141
+ "name": "encoder.layer.4.intermediate.dense.weight",
1142
+ "shape": [
1143
+ 1536,
1144
+ 384
1145
+ ],
1146
+ "kind": "factor",
1147
+ "rank": 71,
1148
+ "matrix_shape": [
1149
+ 1536,
1150
+ 384
1151
+ ]
1152
+ },
1153
+ {
1154
+ "key": "t111",
1155
+ "name": "encoder.layer.4.layernorm_after.bias",
1156
+ "shape": [
1157
+ 384
1158
+ ],
1159
+ "kind": "replacement"
1160
+ },
1161
+ {
1162
+ "key": "t112",
1163
+ "name": "encoder.layer.4.layernorm_after.weight",
1164
+ "shape": [
1165
+ 384
1166
+ ],
1167
+ "kind": "replacement"
1168
+ },
1169
+ {
1170
+ "key": "t113",
1171
+ "name": "encoder.layer.4.layernorm_before.bias",
1172
+ "shape": [
1173
+ 384
1174
+ ],
1175
+ "kind": "replacement"
1176
+ },
1177
+ {
1178
+ "key": "t114",
1179
+ "name": "encoder.layer.4.layernorm_before.weight",
1180
+ "shape": [
1181
+ 384
1182
+ ],
1183
+ "kind": "replacement"
1184
+ },
1185
+ {
1186
+ "key": "t115",
1187
+ "name": "encoder.layer.4.output.dense.bias",
1188
+ "shape": [
1189
+ 384
1190
+ ],
1191
+ "kind": "replacement"
1192
+ },
1193
+ {
1194
+ "key": "t116",
1195
+ "name": "encoder.layer.4.output.dense.weight",
1196
+ "shape": [
1197
+ 384,
1198
+ 1536
1199
+ ],
1200
+ "kind": "factor",
1201
+ "rank": 71,
1202
+ "matrix_shape": [
1203
+ 384,
1204
+ 1536
1205
+ ]
1206
+ },
1207
+ {
1208
+ "key": "t117",
1209
+ "name": "encoder.layer.5.attention.attention.key.bias",
1210
+ "shape": [
1211
+ 384
1212
+ ],
1213
+ "kind": "replacement"
1214
+ },
1215
+ {
1216
+ "key": "t118",
1217
+ "name": "encoder.layer.5.attention.attention.key.weight",
1218
+ "shape": [
1219
+ 384,
1220
+ 384
1221
+ ],
1222
+ "kind": "factor",
1223
+ "rank": 71,
1224
+ "matrix_shape": [
1225
+ 384,
1226
+ 384
1227
+ ]
1228
+ },
1229
+ {
1230
+ "key": "t119",
1231
+ "name": "encoder.layer.5.attention.attention.query.bias",
1232
+ "shape": [
1233
+ 384
1234
+ ],
1235
+ "kind": "replacement"
1236
+ },
1237
+ {
1238
+ "key": "t120",
1239
+ "name": "encoder.layer.5.attention.attention.query.weight",
1240
+ "shape": [
1241
+ 384,
1242
+ 384
1243
+ ],
1244
+ "kind": "factor",
1245
+ "rank": 71,
1246
+ "matrix_shape": [
1247
+ 384,
1248
+ 384
1249
+ ]
1250
+ },
1251
+ {
1252
+ "key": "t121",
1253
+ "name": "encoder.layer.5.attention.attention.value.bias",
1254
+ "shape": [
1255
+ 384
1256
+ ],
1257
+ "kind": "replacement"
1258
+ },
1259
+ {
1260
+ "key": "t122",
1261
+ "name": "encoder.layer.5.attention.attention.value.weight",
1262
+ "shape": [
1263
+ 384,
1264
+ 384
1265
+ ],
1266
+ "kind": "factor",
1267
+ "rank": 71,
1268
+ "matrix_shape": [
1269
+ 384,
1270
+ 384
1271
+ ]
1272
+ },
1273
+ {
1274
+ "key": "t123",
1275
+ "name": "encoder.layer.5.attention.output.dense.bias",
1276
+ "shape": [
1277
+ 384
1278
+ ],
1279
+ "kind": "replacement"
1280
+ },
1281
+ {
1282
+ "key": "t124",
1283
+ "name": "encoder.layer.5.attention.output.dense.weight",
1284
+ "shape": [
1285
+ 384,
1286
+ 384
1287
+ ],
1288
+ "kind": "factor",
1289
+ "rank": 71,
1290
+ "matrix_shape": [
1291
+ 384,
1292
+ 384
1293
+ ]
1294
+ },
1295
+ {
1296
+ "key": "t125",
1297
+ "name": "encoder.layer.5.intermediate.dense.bias",
1298
+ "shape": [
1299
+ 1536
1300
+ ],
1301
+ "kind": "replacement"
1302
+ },
1303
+ {
1304
+ "key": "t126",
1305
+ "name": "encoder.layer.5.intermediate.dense.weight",
1306
+ "shape": [
1307
+ 1536,
1308
+ 384
1309
+ ],
1310
+ "kind": "factor",
1311
+ "rank": 71,
1312
+ "matrix_shape": [
1313
+ 1536,
1314
+ 384
1315
+ ]
1316
+ },
1317
+ {
1318
+ "key": "t127",
1319
+ "name": "encoder.layer.5.layernorm_after.bias",
1320
+ "shape": [
1321
+ 384
1322
+ ],
1323
+ "kind": "replacement"
1324
+ },
1325
+ {
1326
+ "key": "t128",
1327
+ "name": "encoder.layer.5.layernorm_after.weight",
1328
+ "shape": [
1329
+ 384
1330
+ ],
1331
+ "kind": "replacement"
1332
+ },
1333
+ {
1334
+ "key": "t129",
1335
+ "name": "encoder.layer.5.layernorm_before.bias",
1336
+ "shape": [
1337
+ 384
1338
+ ],
1339
+ "kind": "replacement"
1340
+ },
1341
+ {
1342
+ "key": "t130",
1343
+ "name": "encoder.layer.5.layernorm_before.weight",
1344
+ "shape": [
1345
+ 384
1346
+ ],
1347
+ "kind": "replacement"
1348
+ },
1349
+ {
1350
+ "key": "t131",
1351
+ "name": "encoder.layer.5.output.dense.bias",
1352
+ "shape": [
1353
+ 384
1354
+ ],
1355
+ "kind": "replacement"
1356
+ },
1357
+ {
1358
+ "key": "t132",
1359
+ "name": "encoder.layer.5.output.dense.weight",
1360
+ "shape": [
1361
+ 384,
1362
+ 1536
1363
+ ],
1364
+ "kind": "factor",
1365
+ "rank": 71,
1366
+ "matrix_shape": [
1367
+ 384,
1368
+ 1536
1369
+ ]
1370
+ },
1371
+ {
1372
+ "key": "t133",
1373
+ "name": "encoder.layer.6.attention.attention.key.bias",
1374
+ "shape": [
1375
+ 384
1376
+ ],
1377
+ "kind": "replacement"
1378
+ },
1379
+ {
1380
+ "key": "t134",
1381
+ "name": "encoder.layer.6.attention.attention.key.weight",
1382
+ "shape": [
1383
+ 384,
1384
+ 384
1385
+ ],
1386
+ "kind": "factor",
1387
+ "rank": 71,
1388
+ "matrix_shape": [
1389
+ 384,
1390
+ 384
1391
+ ]
1392
+ },
1393
+ {
1394
+ "key": "t135",
1395
+ "name": "encoder.layer.6.attention.attention.query.bias",
1396
+ "shape": [
1397
+ 384
1398
+ ],
1399
+ "kind": "replacement"
1400
+ },
1401
+ {
1402
+ "key": "t136",
1403
+ "name": "encoder.layer.6.attention.attention.query.weight",
1404
+ "shape": [
1405
+ 384,
1406
+ 384
1407
+ ],
1408
+ "kind": "factor",
1409
+ "rank": 71,
1410
+ "matrix_shape": [
1411
+ 384,
1412
+ 384
1413
+ ]
1414
+ },
1415
+ {
1416
+ "key": "t137",
1417
+ "name": "encoder.layer.6.attention.attention.value.bias",
1418
+ "shape": [
1419
+ 384
1420
+ ],
1421
+ "kind": "replacement"
1422
+ },
1423
+ {
1424
+ "key": "t138",
1425
+ "name": "encoder.layer.6.attention.attention.value.weight",
1426
+ "shape": [
1427
+ 384,
1428
+ 384
1429
+ ],
1430
+ "kind": "factor",
1431
+ "rank": 71,
1432
+ "matrix_shape": [
1433
+ 384,
1434
+ 384
1435
+ ]
1436
+ },
1437
+ {
1438
+ "key": "t139",
1439
+ "name": "encoder.layer.6.attention.output.dense.bias",
1440
+ "shape": [
1441
+ 384
1442
+ ],
1443
+ "kind": "replacement"
1444
+ },
1445
+ {
1446
+ "key": "t140",
1447
+ "name": "encoder.layer.6.attention.output.dense.weight",
1448
+ "shape": [
1449
+ 384,
1450
+ 384
1451
+ ],
1452
+ "kind": "factor",
1453
+ "rank": 71,
1454
+ "matrix_shape": [
1455
+ 384,
1456
+ 384
1457
+ ]
1458
+ },
1459
+ {
1460
+ "key": "t141",
1461
+ "name": "encoder.layer.6.intermediate.dense.bias",
1462
+ "shape": [
1463
+ 1536
1464
+ ],
1465
+ "kind": "replacement"
1466
+ },
1467
+ {
1468
+ "key": "t142",
1469
+ "name": "encoder.layer.6.intermediate.dense.weight",
1470
+ "shape": [
1471
+ 1536,
1472
+ 384
1473
+ ],
1474
+ "kind": "factor",
1475
+ "rank": 71,
1476
+ "matrix_shape": [
1477
+ 1536,
1478
+ 384
1479
+ ]
1480
+ },
1481
+ {
1482
+ "key": "t143",
1483
+ "name": "encoder.layer.6.layernorm_after.bias",
1484
+ "shape": [
1485
+ 384
1486
+ ],
1487
+ "kind": "replacement"
1488
+ },
1489
+ {
1490
+ "key": "t144",
1491
+ "name": "encoder.layer.6.layernorm_after.weight",
1492
+ "shape": [
1493
+ 384
1494
+ ],
1495
+ "kind": "replacement"
1496
+ },
1497
+ {
1498
+ "key": "t145",
1499
+ "name": "encoder.layer.6.layernorm_before.bias",
1500
+ "shape": [
1501
+ 384
1502
+ ],
1503
+ "kind": "replacement"
1504
+ },
1505
+ {
1506
+ "key": "t146",
1507
+ "name": "encoder.layer.6.layernorm_before.weight",
1508
+ "shape": [
1509
+ 384
1510
+ ],
1511
+ "kind": "replacement"
1512
+ },
1513
+ {
1514
+ "key": "t147",
1515
+ "name": "encoder.layer.6.output.dense.bias",
1516
+ "shape": [
1517
+ 384
1518
+ ],
1519
+ "kind": "replacement"
1520
+ },
1521
+ {
1522
+ "key": "t148",
1523
+ "name": "encoder.layer.6.output.dense.weight",
1524
+ "shape": [
1525
+ 384,
1526
+ 1536
1527
+ ],
1528
+ "kind": "factor",
1529
+ "rank": 71,
1530
+ "matrix_shape": [
1531
+ 384,
1532
+ 1536
1533
+ ]
1534
+ },
1535
+ {
1536
+ "key": "t149",
1537
+ "name": "encoder.layer.7.attention.attention.key.bias",
1538
+ "shape": [
1539
+ 384
1540
+ ],
1541
+ "kind": "replacement"
1542
+ },
1543
+ {
1544
+ "key": "t150",
1545
+ "name": "encoder.layer.7.attention.attention.key.weight",
1546
+ "shape": [
1547
+ 384,
1548
+ 384
1549
+ ],
1550
+ "kind": "factor",
1551
+ "rank": 71,
1552
+ "matrix_shape": [
1553
+ 384,
1554
+ 384
1555
+ ]
1556
+ },
1557
+ {
1558
+ "key": "t151",
1559
+ "name": "encoder.layer.7.attention.attention.query.bias",
1560
+ "shape": [
1561
+ 384
1562
+ ],
1563
+ "kind": "replacement"
1564
+ },
1565
+ {
1566
+ "key": "t152",
1567
+ "name": "encoder.layer.7.attention.attention.query.weight",
1568
+ "shape": [
1569
+ 384,
1570
+ 384
1571
+ ],
1572
+ "kind": "factor",
1573
+ "rank": 71,
1574
+ "matrix_shape": [
1575
+ 384,
1576
+ 384
1577
+ ]
1578
+ },
1579
+ {
1580
+ "key": "t153",
1581
+ "name": "encoder.layer.7.attention.attention.value.bias",
1582
+ "shape": [
1583
+ 384
1584
+ ],
1585
+ "kind": "replacement"
1586
+ },
1587
+ {
1588
+ "key": "t154",
1589
+ "name": "encoder.layer.7.attention.attention.value.weight",
1590
+ "shape": [
1591
+ 384,
1592
+ 384
1593
+ ],
1594
+ "kind": "factor",
1595
+ "rank": 71,
1596
+ "matrix_shape": [
1597
+ 384,
1598
+ 384
1599
+ ]
1600
+ },
1601
+ {
1602
+ "key": "t155",
1603
+ "name": "encoder.layer.7.attention.output.dense.bias",
1604
+ "shape": [
1605
+ 384
1606
+ ],
1607
+ "kind": "replacement"
1608
+ },
1609
+ {
1610
+ "key": "t156",
1611
+ "name": "encoder.layer.7.attention.output.dense.weight",
1612
+ "shape": [
1613
+ 384,
1614
+ 384
1615
+ ],
1616
+ "kind": "factor",
1617
+ "rank": 71,
1618
+ "matrix_shape": [
1619
+ 384,
1620
+ 384
1621
+ ]
1622
+ },
1623
+ {
1624
+ "key": "t157",
1625
+ "name": "encoder.layer.7.intermediate.dense.bias",
1626
+ "shape": [
1627
+ 1536
1628
+ ],
1629
+ "kind": "replacement"
1630
+ },
1631
+ {
1632
+ "key": "t158",
1633
+ "name": "encoder.layer.7.intermediate.dense.weight",
1634
+ "shape": [
1635
+ 1536,
1636
+ 384
1637
+ ],
1638
+ "kind": "factor",
1639
+ "rank": 71,
1640
+ "matrix_shape": [
1641
+ 1536,
1642
+ 384
1643
+ ]
1644
+ },
1645
+ {
1646
+ "key": "t159",
1647
+ "name": "encoder.layer.7.layernorm_after.bias",
1648
+ "shape": [
1649
+ 384
1650
+ ],
1651
+ "kind": "replacement"
1652
+ },
1653
+ {
1654
+ "key": "t160",
1655
+ "name": "encoder.layer.7.layernorm_after.weight",
1656
+ "shape": [
1657
+ 384
1658
+ ],
1659
+ "kind": "replacement"
1660
+ },
1661
+ {
1662
+ "key": "t161",
1663
+ "name": "encoder.layer.7.layernorm_before.bias",
1664
+ "shape": [
1665
+ 384
1666
+ ],
1667
+ "kind": "replacement"
1668
+ },
1669
+ {
1670
+ "key": "t162",
1671
+ "name": "encoder.layer.7.layernorm_before.weight",
1672
+ "shape": [
1673
+ 384
1674
+ ],
1675
+ "kind": "replacement"
1676
+ },
1677
+ {
1678
+ "key": "t163",
1679
+ "name": "encoder.layer.7.output.dense.bias",
1680
+ "shape": [
1681
+ 384
1682
+ ],
1683
+ "kind": "replacement"
1684
+ },
1685
+ {
1686
+ "key": "t164",
1687
+ "name": "encoder.layer.7.output.dense.weight",
1688
+ "shape": [
1689
+ 384,
1690
+ 1536
1691
+ ],
1692
+ "kind": "factor",
1693
+ "rank": 71,
1694
+ "matrix_shape": [
1695
+ 384,
1696
+ 1536
1697
+ ]
1698
+ },
1699
+ {
1700
+ "key": "t165",
1701
+ "name": "encoder.layer.8.attention.attention.key.bias",
1702
+ "shape": [
1703
+ 384
1704
+ ],
1705
+ "kind": "replacement"
1706
+ },
1707
+ {
1708
+ "key": "t166",
1709
+ "name": "encoder.layer.8.attention.attention.key.weight",
1710
+ "shape": [
1711
+ 384,
1712
+ 384
1713
+ ],
1714
+ "kind": "factor",
1715
+ "rank": 71,
1716
+ "matrix_shape": [
1717
+ 384,
1718
+ 384
1719
+ ]
1720
+ },
1721
+ {
1722
+ "key": "t167",
1723
+ "name": "encoder.layer.8.attention.attention.query.bias",
1724
+ "shape": [
1725
+ 384
1726
+ ],
1727
+ "kind": "replacement"
1728
+ },
1729
+ {
1730
+ "key": "t168",
1731
+ "name": "encoder.layer.8.attention.attention.query.weight",
1732
+ "shape": [
1733
+ 384,
1734
+ 384
1735
+ ],
1736
+ "kind": "factor",
1737
+ "rank": 71,
1738
+ "matrix_shape": [
1739
+ 384,
1740
+ 384
1741
+ ]
1742
+ },
1743
+ {
1744
+ "key": "t169",
1745
+ "name": "encoder.layer.8.attention.attention.value.bias",
1746
+ "shape": [
1747
+ 384
1748
+ ],
1749
+ "kind": "replacement"
1750
+ },
1751
+ {
1752
+ "key": "t170",
1753
+ "name": "encoder.layer.8.attention.attention.value.weight",
1754
+ "shape": [
1755
+ 384,
1756
+ 384
1757
+ ],
1758
+ "kind": "factor",
1759
+ "rank": 71,
1760
+ "matrix_shape": [
1761
+ 384,
1762
+ 384
1763
+ ]
1764
+ },
1765
+ {
1766
+ "key": "t171",
1767
+ "name": "encoder.layer.8.attention.output.dense.bias",
1768
+ "shape": [
1769
+ 384
1770
+ ],
1771
+ "kind": "replacement"
1772
+ },
1773
+ {
1774
+ "key": "t172",
1775
+ "name": "encoder.layer.8.attention.output.dense.weight",
1776
+ "shape": [
1777
+ 384,
1778
+ 384
1779
+ ],
1780
+ "kind": "factor",
1781
+ "rank": 71,
1782
+ "matrix_shape": [
1783
+ 384,
1784
+ 384
1785
+ ]
1786
+ },
1787
+ {
1788
+ "key": "t173",
1789
+ "name": "encoder.layer.8.intermediate.dense.bias",
1790
+ "shape": [
1791
+ 1536
1792
+ ],
1793
+ "kind": "replacement"
1794
+ },
1795
+ {
1796
+ "key": "t174",
1797
+ "name": "encoder.layer.8.intermediate.dense.weight",
1798
+ "shape": [
1799
+ 1536,
1800
+ 384
1801
+ ],
1802
+ "kind": "factor",
1803
+ "rank": 71,
1804
+ "matrix_shape": [
1805
+ 1536,
1806
+ 384
1807
+ ]
1808
+ },
1809
+ {
1810
+ "key": "t175",
1811
+ "name": "encoder.layer.8.layernorm_after.bias",
1812
+ "shape": [
1813
+ 384
1814
+ ],
1815
+ "kind": "replacement"
1816
+ },
1817
+ {
1818
+ "key": "t176",
1819
+ "name": "encoder.layer.8.layernorm_after.weight",
1820
+ "shape": [
1821
+ 384
1822
+ ],
1823
+ "kind": "replacement"
1824
+ },
1825
+ {
1826
+ "key": "t177",
1827
+ "name": "encoder.layer.8.layernorm_before.bias",
1828
+ "shape": [
1829
+ 384
1830
+ ],
1831
+ "kind": "replacement"
1832
+ },
1833
+ {
1834
+ "key": "t178",
1835
+ "name": "encoder.layer.8.layernorm_before.weight",
1836
+ "shape": [
1837
+ 384
1838
+ ],
1839
+ "kind": "replacement"
1840
+ },
1841
+ {
1842
+ "key": "t179",
1843
+ "name": "encoder.layer.8.output.dense.bias",
1844
+ "shape": [
1845
+ 384
1846
+ ],
1847
+ "kind": "replacement"
1848
+ },
1849
+ {
1850
+ "key": "t180",
1851
+ "name": "encoder.layer.8.output.dense.weight",
1852
+ "shape": [
1853
+ 384,
1854
+ 1536
1855
+ ],
1856
+ "kind": "factor",
1857
+ "rank": 71,
1858
+ "matrix_shape": [
1859
+ 384,
1860
+ 1536
1861
+ ]
1862
+ },
1863
+ {
1864
+ "key": "t181",
1865
+ "name": "encoder.layer.9.attention.attention.key.bias",
1866
+ "shape": [
1867
+ 384
1868
+ ],
1869
+ "kind": "replacement"
1870
+ },
1871
+ {
1872
+ "key": "t182",
1873
+ "name": "encoder.layer.9.attention.attention.key.weight",
1874
+ "shape": [
1875
+ 384,
1876
+ 384
1877
+ ],
1878
+ "kind": "factor",
1879
+ "rank": 71,
1880
+ "matrix_shape": [
1881
+ 384,
1882
+ 384
1883
+ ]
1884
+ },
1885
+ {
1886
+ "key": "t183",
1887
+ "name": "encoder.layer.9.attention.attention.query.bias",
1888
+ "shape": [
1889
+ 384
1890
+ ],
1891
+ "kind": "replacement"
1892
+ },
1893
+ {
1894
+ "key": "t184",
1895
+ "name": "encoder.layer.9.attention.attention.query.weight",
1896
+ "shape": [
1897
+ 384,
1898
+ 384
1899
+ ],
1900
+ "kind": "factor",
1901
+ "rank": 71,
1902
+ "matrix_shape": [
1903
+ 384,
1904
+ 384
1905
+ ]
1906
+ },
1907
+ {
1908
+ "key": "t185",
1909
+ "name": "encoder.layer.9.attention.attention.value.bias",
1910
+ "shape": [
1911
+ 384
1912
+ ],
1913
+ "kind": "replacement"
1914
+ },
1915
+ {
1916
+ "key": "t186",
1917
+ "name": "encoder.layer.9.attention.attention.value.weight",
1918
+ "shape": [
1919
+ 384,
1920
+ 384
1921
+ ],
1922
+ "kind": "factor",
1923
+ "rank": 71,
1924
+ "matrix_shape": [
1925
+ 384,
1926
+ 384
1927
+ ]
1928
+ },
1929
+ {
1930
+ "key": "t187",
1931
+ "name": "encoder.layer.9.attention.output.dense.bias",
1932
+ "shape": [
1933
+ 384
1934
+ ],
1935
+ "kind": "replacement"
1936
+ },
1937
+ {
1938
+ "key": "t188",
1939
+ "name": "encoder.layer.9.attention.output.dense.weight",
1940
+ "shape": [
1941
+ 384,
1942
+ 384
1943
+ ],
1944
+ "kind": "factor",
1945
+ "rank": 71,
1946
+ "matrix_shape": [
1947
+ 384,
1948
+ 384
1949
+ ]
1950
+ },
1951
+ {
1952
+ "key": "t189",
1953
+ "name": "encoder.layer.9.intermediate.dense.bias",
1954
+ "shape": [
1955
+ 1536
1956
+ ],
1957
+ "kind": "replacement"
1958
+ },
1959
+ {
1960
+ "key": "t190",
1961
+ "name": "encoder.layer.9.intermediate.dense.weight",
1962
+ "shape": [
1963
+ 1536,
1964
+ 384
1965
+ ],
1966
+ "kind": "factor",
1967
+ "rank": 71,
1968
+ "matrix_shape": [
1969
+ 1536,
1970
+ 384
1971
+ ]
1972
+ },
1973
+ {
1974
+ "key": "t191",
1975
+ "name": "encoder.layer.9.layernorm_after.bias",
1976
+ "shape": [
1977
+ 384
1978
+ ],
1979
+ "kind": "replacement"
1980
+ },
1981
+ {
1982
+ "key": "t192",
1983
+ "name": "encoder.layer.9.layernorm_after.weight",
1984
+ "shape": [
1985
+ 384
1986
+ ],
1987
+ "kind": "replacement"
1988
+ },
1989
+ {
1990
+ "key": "t193",
1991
+ "name": "encoder.layer.9.layernorm_before.bias",
1992
+ "shape": [
1993
+ 384
1994
+ ],
1995
+ "kind": "replacement"
1996
+ },
1997
+ {
1998
+ "key": "t194",
1999
+ "name": "encoder.layer.9.layernorm_before.weight",
2000
+ "shape": [
2001
+ 384
2002
+ ],
2003
+ "kind": "replacement"
2004
+ },
2005
+ {
2006
+ "key": "t195",
2007
+ "name": "encoder.layer.9.output.dense.bias",
2008
+ "shape": [
2009
+ 384
2010
+ ],
2011
+ "kind": "replacement"
2012
+ },
2013
+ {
2014
+ "key": "t196",
2015
+ "name": "encoder.layer.9.output.dense.weight",
2016
+ "shape": [
2017
+ 384,
2018
+ 1536
2019
+ ],
2020
+ "kind": "factor",
2021
+ "rank": 71,
2022
+ "matrix_shape": [
2023
+ 384,
2024
+ 1536
2025
+ ]
2026
+ },
2027
+ {
2028
+ "key": "t197",
2029
+ "name": "layernorm.bias",
2030
+ "shape": [
2031
+ 384
2032
+ ],
2033
+ "kind": "replacement"
2034
+ },
2035
+ {
2036
+ "key": "t198",
2037
+ "name": "layernorm.weight",
2038
+ "shape": [
2039
+ 384
2040
+ ],
2041
+ "kind": "replacement"
2042
+ }
2043
+ ],
2044
+ "files_sha256": {
2045
+ "weights.safetensors": "9b58d252978d3a5d33adcdaea95e113162daf5146e20a9e1b8aa47e21e48ed93",
2046
+ "english-assets/README.md": "7e0f183a2697956065aea4e3ec9ca718967be1b7afe446cff4dcdbc8a64fa52b",
2047
+ "english-assets/config.json": "2b6e06edec319984eca99c932d940bfa1f308db3f74d6279440b906c373bf727",
2048
+ "english-assets/generation_config.json": "41149cdcffec4d657f32dfcddd9b208037f01286c9e07945c724908c58ed0193",
2049
+ "english-assets/preprocessor_config.json": "eec0c686d2e2ea6d5887f87e1c6a34ef5bf1ba5b2ac98b8675e131da646fa1d2",
2050
+ "english-assets/sentencepiece.bpe.model": "6f5e2fefcf793761a76a6bfb8ad35489f9c203b25557673284b6d032f41043f4",
2051
+ "english-assets/special_tokens_map.json": "58dc0a3d15e3bad4861bcf2dee770ea327344d185182d4c5d2bf253285e53a83",
2052
+ "english-assets/tokenizer_config.json": "e098c98c6834fbcd3f3e75215e3e8b8868f0fe5bf07aef93d28e4f7196db293c",
2053
+ "character-assets/config.json": "decbe7681cc6000bd5bf83226b295e7a051e8280bc12255961e011d2caadbfce",
2054
+ "character-assets/generation_config.json": "9577d3da76b60ee97a70d1516ac144eba329a8a70dd0e96c6f721c910434dcff",
2055
+ "character-assets/character_codec.json": "7bb65c86bc29b555f8da3af81b7023e370bdebe6ced8c84d104d55165c6ffb0a",
2056
+ "character-assets/preprocessor_config.json": "36a945a7cc645688b9ef64dabae16979cf5f7c1c448569cc306694edc0598b9b",
2057
+ "model-configs.json": "1c598da84fcbe26af738d5ef1c0ea04f80f965e7690b1089aeaa8c7977cd4359",
2058
+ "english-generation.json": "cddf3683b66672c43fee2a6d966829eebf2a00c61d376d0eb30db972693210be",
2059
+ "character-generation.json": "02b8abbca9b3f1e5fb8ea2057b0aea84e1f488dd5dd2ca52a75850170bc3b08b"
2060
+ },
2061
+ "uniform_rank": 71,
2062
+ "routing_parameters_reserved": 100000,
2063
+ "automatic_dispatch": false,
2064
+ "scope": "Serial CPU source candidate only; no accuracy or native Paddle qualification",
2065
+ "original_model_sha256": "1b83102cbc1520dee1c3937ac334da83da18cf4683d46ebd1bd4e93ebe584dd7",
2066
+ "parent_bundle_sha256": "b9281e7da68d2b9c331697a9fb15da3a2366fb937fce00742d658987d924318e",
2067
+ "training_run_sha256": "713dfd450e19d12523585d9973aad7a7236097e64206e035800bbdcfeacb21e3",
2068
+ "training_step": 8000,
2069
+ "training_chain": "5e79546a138135b739b6485f3af4d81d412baa44119e849ec307ac8d87dff4ec",
2070
+ "initial_character_model_sha256": "fcc1346b8c6aa36ae04b8628deb5cd309aa09d4574f0ed9ee0ce4d124091174a",
2071
+ "root_bundle_sha256": "a52a68c8950c7eada39215d52b7b1eaf893d23577297951019bce382689baf48",
2072
+ "parent_training_step": 8000,
2073
+ "cumulative_training_step": 16000,
2074
+ "parent_training_run_sha256": "f33da3168d15a743a4e73a59a77a55f5c85e41ee675cf006a00c940b9a23c70b"
2075
+ }
source-model/character-assets/character_codec.json ADDED
@@ -0,0 +1,590 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "kind": "literal_NFC_characters",
4
+ "classes": 573,
5
+ "special_ids": {
6
+ "BOS_serialization": 0,
7
+ "PAD": 1,
8
+ "EOS_and_decoder_start": 2,
9
+ "UNK": 3
10
+ },
11
+ "character_ids": {
12
+ "!": 4,
13
+ "\"": 5,
14
+ "#": 6,
15
+ "$": 7,
16
+ "%": 8,
17
+ "&": 9,
18
+ "'": 10,
19
+ "(": 11,
20
+ ")": 12,
21
+ "*": 13,
22
+ "+": 14,
23
+ ",": 15,
24
+ "-": 16,
25
+ ".": 17,
26
+ "/": 18,
27
+ "0": 19,
28
+ "1": 20,
29
+ "2": 21,
30
+ "3": 22,
31
+ "4": 23,
32
+ "5": 24,
33
+ "6": 25,
34
+ "7": 26,
35
+ "8": 27,
36
+ "9": 28,
37
+ ":": 29,
38
+ ";": 30,
39
+ "<": 31,
40
+ "=": 32,
41
+ ">": 33,
42
+ "?": 34,
43
+ "A": 35,
44
+ "B": 36,
45
+ "C": 37,
46
+ "D": 38,
47
+ "E": 39,
48
+ "F": 40,
49
+ "G": 41,
50
+ "H": 42,
51
+ "I": 43,
52
+ "J": 44,
53
+ "K": 45,
54
+ "L": 46,
55
+ "M": 47,
56
+ "N": 48,
57
+ "O": 49,
58
+ "P": 50,
59
+ "Q": 51,
60
+ "R": 52,
61
+ "S": 53,
62
+ "T": 54,
63
+ "U": 55,
64
+ "V": 56,
65
+ "W": 57,
66
+ "X": 58,
67
+ "Y": 59,
68
+ "Z": 60,
69
+ "[": 61,
70
+ "]": 62,
71
+ "_": 63,
72
+ "`": 64,
73
+ "a": 65,
74
+ "b": 66,
75
+ "c": 67,
76
+ "d": 68,
77
+ "e": 69,
78
+ "f": 70,
79
+ "g": 71,
80
+ "h": 72,
81
+ "i": 73,
82
+ "j": 74,
83
+ "k": 75,
84
+ "l": 76,
85
+ "m": 77,
86
+ "n": 78,
87
+ "o": 79,
88
+ "p": 80,
89
+ "q": 81,
90
+ "r": 82,
91
+ "s": 83,
92
+ "t": 84,
93
+ "u": 85,
94
+ "v": 86,
95
+ "w": 87,
96
+ "x": 88,
97
+ "y": 89,
98
+ "z": 90,
99
+ "©": 91,
100
+ "‥": 92,
101
+ "{": 93,
102
+ "}": 94,
103
+ "\\": 95,
104
+ "|": 96,
105
+ "@": 97,
106
+ "^": 98,
107
+ "~": 99,
108
+ "÷": 100,
109
+ "∕": 101,
110
+ "∙": 102,
111
+ "⋅": 103,
112
+ "·": 104,
113
+ "±": 105,
114
+ "∓": 106,
115
+ "∩": 107,
116
+ "∪": 108,
117
+ "□": 109,
118
+ "←": 110,
119
+ "↔": 111,
120
+ "⇒": 112,
121
+ "⇐": 113,
122
+ "⇔": 114,
123
+ "∀": 115,
124
+ "∃": 116,
125
+ "∄": 117,
126
+ "∴": 118,
127
+ "∵": 119,
128
+ "∝": 120,
129
+ "∞": 121,
130
+ "⊥": 122,
131
+ "∟": 123,
132
+ "∠": 124,
133
+ "∡": 125,
134
+ "∢": 126,
135
+ "′": 127,
136
+ "″": 128,
137
+ "∥": 129,
138
+ "⊾": 130,
139
+ "⊿": 131,
140
+ "∂": 132,
141
+ "∫": 133,
142
+ "∬": 134,
143
+ "∭": 135,
144
+ "∮": 136,
145
+ "∯": 137,
146
+ "∰": 138,
147
+ "∑": 139,
148
+ "∏": 140,
149
+ "√": 141,
150
+ "∛": 142,
151
+ "∜": 143,
152
+ "∱": 144,
153
+ "∲": 145,
154
+ "∳": 146,
155
+ "∶": 147,
156
+ "∷": 148,
157
+ "∼": 149,
158
+ "®": 150,
159
+ "℉": 151,
160
+ "Ω": 152,
161
+ "℧": 153,
162
+ "Å": 154,
163
+ "⌀": 155,
164
+ "ℏ": 156,
165
+ "⅀": 157,
166
+ "⍺": 158,
167
+ "⍵": 159,
168
+ "¢": 160,
169
+ "€": 161,
170
+ "£": 162,
171
+ "¥": 163,
172
+ "₿": 164,
173
+ "Ⅰ": 165,
174
+ "Ⅱ": 166,
175
+ "Ⅲ": 167,
176
+ "Ⅳ": 168,
177
+ "Ⅴ": 169,
178
+ "Ⅵ": 170,
179
+ "Ⅶ": 171,
180
+ "Ⅷ": 172,
181
+ "Ⅸ": 173,
182
+ "Ⅹ": 174,
183
+ "Ⅺ": 175,
184
+ "Ⅻ": 176,
185
+ "ⅰ": 177,
186
+ "ⅱ": 178,
187
+ "ⅲ": 179,
188
+ "ⅳ": 180,
189
+ "ⅴ": 181,
190
+ "ⅵ": 182,
191
+ "ⅶ": 183,
192
+ "ⅷ": 184,
193
+ "ⅸ": 185,
194
+ "ⅹ": 186,
195
+ "ⅺ": 187,
196
+ "ⅻ": 188,
197
+ "➀": 189,
198
+ "➁": 190,
199
+ "➂": 191,
200
+ "➃": 192,
201
+ "➄": 193,
202
+ "➅": 194,
203
+ "➆": 195,
204
+ "➇": 196,
205
+ "➈": 197,
206
+ "➉": 198,
207
+ "➊": 199,
208
+ "➋": 200,
209
+ "➌": 201,
210
+ "➍": 202,
211
+ "➎": 203,
212
+ "➏": 204,
213
+ "➐": 205,
214
+ "➑": 206,
215
+ "➒": 207,
216
+ "➓": 208,
217
+ "❶": 209,
218
+ "❷": 210,
219
+ "❸": 211,
220
+ "❹": 212,
221
+ "❺": 213,
222
+ "❻": 214,
223
+ "❼": 215,
224
+ "❽": 216,
225
+ "❾": 217,
226
+ "❿": 218,
227
+ "①": 219,
228
+ "②": 220,
229
+ "③": 221,
230
+ "④": 222,
231
+ "⑤": 223,
232
+ "⑥": 224,
233
+ "⑦": 225,
234
+ "⑧": 226,
235
+ "⑨": 227,
236
+ "⑩": 228,
237
+ "●": 229,
238
+ "▶": 230,
239
+ "𝑢": 231,
240
+ "︽": 232,
241
+ "–": 233,
242
+ "﹥": 234,
243
+ "𝜓": 235,
244
+ "•": 236,
245
+ "∋": 237,
246
+ "ƒ": 238,
247
+ "⬆": 239,
248
+ "Ạ": 240,
249
+ "◀": 241,
250
+ "": 242,
251
+ "▫": 243,
252
+ "︾": 244,
253
+ "À": 245,
254
+ "Á": 246,
255
+ "Â": 247,
256
+ "Ã": 248,
257
+ "Ä": 249,
258
+ "Å": 250,
259
+ "Æ": 251,
260
+ "Ç": 252,
261
+ "È": 253,
262
+ "É": 254,
263
+ "Ê": 255,
264
+ "Ë": 256,
265
+ "Ì": 257,
266
+ "Í": 258,
267
+ "Î": 259,
268
+ "Ï": 260,
269
+ "Ð": 261,
270
+ "Ñ": 262,
271
+ "Ò": 263,
272
+ "Ó": 264,
273
+ "Ô": 265,
274
+ "Õ": 266,
275
+ "Ö": 267,
276
+ "Ø": 268,
277
+ "Ù": 269,
278
+ "Ú": 270,
279
+ "Û": 271,
280
+ "Ü": 272,
281
+ "Ý": 273,
282
+ "Þ": 274,
283
+ "à": 275,
284
+ "á": 276,
285
+ "â": 277,
286
+ "ã": 278,
287
+ "ä": 279,
288
+ "å": 280,
289
+ "æ": 281,
290
+ "ç": 282,
291
+ "è": 283,
292
+ "é": 284,
293
+ "ê": 285,
294
+ "ë": 286,
295
+ "ì": 287,
296
+ "í": 288,
297
+ "î": 289,
298
+ "ï": 290,
299
+ "ð": 291,
300
+ "ñ": 292,
301
+ "ò": 293,
302
+ "ó": 294,
303
+ "ô": 295,
304
+ "õ": 296,
305
+ "ö": 297,
306
+ "ø": 298,
307
+ "ù": 299,
308
+ "ú": 300,
309
+ "û": 301,
310
+ "ü": 302,
311
+ "ý": 303,
312
+ "þ": 304,
313
+ "ÿ": 305,
314
+ "¡": 306,
315
+ "¤": 307,
316
+ "¦": 308,
317
+ "§": 309,
318
+ "¨": 310,
319
+ "ª": 311,
320
+ "«": 312,
321
+ "¬": 313,
322
+ "¯": 314,
323
+ "°": 315,
324
+ "²": 316,
325
+ "³": 317,
326
+ "´": 318,
327
+ "µ": 319,
328
+ "¶": 320,
329
+ "¸": 321,
330
+ "¹": 322,
331
+ "º": 323,
332
+ "»": 324,
333
+ "¼": 325,
334
+ "½": 326,
335
+ "¾": 327,
336
+ "¿": 328,
337
+ "×": 329,
338
+ "‐": 330,
339
+ "‑": 331,
340
+ "‒": 332,
341
+ "—": 333,
342
+ "―": 334,
343
+ "‖": 335,
344
+ "‗": 336,
345
+ "‘": 337,
346
+ "’": 338,
347
+ "‚": 339,
348
+ "‛": 340,
349
+ "“": 341,
350
+ "”": 342,
351
+ "„": 343,
352
+ "‟": 344,
353
+ "†": 345,
354
+ "‡": 346,
355
+ "‣": 347,
356
+ "․": 348,
357
+ "…": 349,
358
+ "‧": 350,
359
+ "‰": 351,
360
+ "‴": 352,
361
+ "‵": 353,
362
+ "‶": 354,
363
+ "‷": 355,
364
+ "‸": 356,
365
+ "‹": 357,
366
+ "›": 358,
367
+ "※": 359,
368
+ "‼": 360,
369
+ "‽": 361,
370
+ "‾": 362,
371
+ "₤": 363,
372
+ "₡": 364,
373
+ "₹": 365,
374
+ "−": 366,
375
+ "∖": 367,
376
+ "∗": 368,
377
+ "≈": 369,
378
+ "≠": 370,
379
+ "≡": 371,
380
+ "≤": 372,
381
+ "≥": 373,
382
+ "⊂": 374,
383
+ "⊃": 375,
384
+ "↑": 376,
385
+ "→": 377,
386
+ "↓": 378,
387
+ "↕": 379,
388
+ "™": 380,
389
+ "Ω": 381,
390
+ "℮": 382,
391
+ "∆": 383,
392
+ "✓": 384,
393
+ "✗": 385,
394
+ "✘": 386,
395
+ "▪": 387,
396
+ "◼": 388,
397
+ "✔": 389,
398
+ "✕": 390,
399
+ "☑": 391,
400
+ "☒": 392,
401
+ "№": 393,
402
+ "₽": 394,
403
+ "₴": 395,
404
+ "Α": 396,
405
+ "α": 397,
406
+ "Β": 398,
407
+ "β": 399,
408
+ "Γ": 400,
409
+ "γ": 401,
410
+ "Δ": 402,
411
+ "δ": 403,
412
+ "Ε": 404,
413
+ "ε": 405,
414
+ "Ζ": 406,
415
+ "ζ": 407,
416
+ "Η": 408,
417
+ "η": 409,
418
+ "Θ": 410,
419
+ "θ": 411,
420
+ "Ι": 412,
421
+ "ι": 413,
422
+ "Κ": 414,
423
+ "κ": 415,
424
+ "Λ": 416,
425
+ "λ": 417,
426
+ "Μ": 418,
427
+ "μ": 419,
428
+ "Ν": 420,
429
+ "ν": 421,
430
+ "Ξ": 422,
431
+ "ξ": 423,
432
+ "Ο": 424,
433
+ "ο": 425,
434
+ "Π": 426,
435
+ "π": 427,
436
+ "Ρ": 428,
437
+ "ρ": 429,
438
+ "Σ": 430,
439
+ "σ": 431,
440
+ "ς": 432,
441
+ "Τ": 433,
442
+ "τ": 434,
443
+ "Υ": 435,
444
+ "υ": 436,
445
+ "Φ": 437,
446
+ "φ": 438,
447
+ "Χ": 439,
448
+ "χ": 440,
449
+ "Ψ": 441,
450
+ "ψ": 442,
451
+ "ω": 443,
452
+ "ऀ": 444,
453
+ "ँ": 445,
454
+ "ं": 446,
455
+ "ः": 447,
456
+ "ऄ": 448,
457
+ "अ": 449,
458
+ "आ": 450,
459
+ "इ": 451,
460
+ "ई": 452,
461
+ "उ": 453,
462
+ "ऊ": 454,
463
+ "ऋ": 455,
464
+ "ऌ": 456,
465
+ "ऍ": 457,
466
+ "ऎ": 458,
467
+ "ए": 459,
468
+ "ऐ": 460,
469
+ "ऑ": 461,
470
+ "ऒ": 462,
471
+ "ओ": 463,
472
+ "औ": 464,
473
+ "क": 465,
474
+ "ख": 466,
475
+ "ग": 467,
476
+ "घ": 468,
477
+ "ङ": 469,
478
+ "च": 470,
479
+ "छ": 471,
480
+ "ज": 472,
481
+ "झ": 473,
482
+ "ञ": 474,
483
+ "ट": 475,
484
+ "ठ": 476,
485
+ "ड": 477,
486
+ "ढ": 478,
487
+ "ण": 479,
488
+ "त": 480,
489
+ "थ": 481,
490
+ "द": 482,
491
+ "ध": 483,
492
+ "न": 484,
493
+ "ऩ": 485,
494
+ "प": 486,
495
+ "फ": 487,
496
+ "ब": 488,
497
+ "भ": 489,
498
+ "म": 490,
499
+ "य": 491,
500
+ "र": 492,
501
+ "ऱ": 493,
502
+ "ल": 494,
503
+ "ळ": 495,
504
+ "ऴ": 496,
505
+ "व": 497,
506
+ "श": 498,
507
+ "ष": 499,
508
+ "स": 500,
509
+ "ह": 501,
510
+ "ऺ": 502,
511
+ "ऻ": 503,
512
+ "़": 504,
513
+ "ऽ": 505,
514
+ "ा": 506,
515
+ "ि": 507,
516
+ "ी": 508,
517
+ "ु": 509,
518
+ "ू": 510,
519
+ "ृ": 511,
520
+ "ॄ": 512,
521
+ "ॅ": 513,
522
+ "ॆ": 514,
523
+ "े": 515,
524
+ "ै": 516,
525
+ "ॉ": 517,
526
+ "ॊ": 518,
527
+ "ो": 519,
528
+ "ौ": 520,
529
+ "्": 521,
530
+ "ॎ": 522,
531
+ "ॏ": 523,
532
+ "ॐ": 524,
533
+ "॑": 525,
534
+ "॒": 526,
535
+ "॓": 527,
536
+ "॔": 528,
537
+ "ॕ": 529,
538
+ "ॖ": 530,
539
+ "ॗ": 531,
540
+ "क़": 532,
541
+ "ख़": 533,
542
+ "ग़": 534,
543
+ "ज़": 535,
544
+ "ड़": 536,
545
+ "ढ़": 537,
546
+ "फ़": 538,
547
+ "य़": 539,
548
+ "ॠ": 540,
549
+ "ॡ": 541,
550
+ "ॢ": 542,
551
+ "ॣ": 543,
552
+ "।": 544,
553
+ "॥": 545,
554
+ "०": 546,
555
+ "१": 547,
556
+ "२": 548,
557
+ "३": 549,
558
+ "४": 550,
559
+ "५": 551,
560
+ "६": 552,
561
+ "७": 553,
562
+ "८": 554,
563
+ "९": 555,
564
+ "॰": 556,
565
+ "ॱ": 557,
566
+ "ॲ": 558,
567
+ "ॳ": 559,
568
+ "ॴ": 560,
569
+ "ॵ": 561,
570
+ "ॶ": 562,
571
+ "ॷ": 563,
572
+ "ॸ": 564,
573
+ "ॹ": 565,
574
+ "ॺ": 566,
575
+ "ॻ": 567,
576
+ "ॼ": 568,
577
+ "ॽ": 569,
578
+ "ॾ": 570,
579
+ "ॿ": 571,
580
+ " ": 572
581
+ },
582
+ "generation_suppressed_ids": [
583
+ 0,
584
+ 1,
585
+ 3
586
+ ],
587
+ "training_target": "Drop serialization BOS0 only; retain every text codepoint and EOS2",
588
+ "unknown_output": "Decode3 as U+FFFD, never silently remove it",
589
+ "scope": "Experimental codec, not recognition quality or Paddle qualification."
590
+ }
source-model/character-assets/config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VisionEncoderDecoderModel"
4
+ ],
5
+ "decoder": {
6
+ "activation_dropout": 0.0,
7
+ "activation_function": "relu",
8
+ "add_cross_attention": true,
9
+ "attention_dropout": 0.0,
10
+ "classifier_dropout": 0.0,
11
+ "cross_attention_hidden_size": 384,
12
+ "d_model": 256,
13
+ "decoder_attention_heads": 8,
14
+ "decoder_ffn_dim": 1024,
15
+ "decoder_layerdrop": 0.0,
16
+ "decoder_layers": 6,
17
+ "dropout": 0.1,
18
+ "dtype": "float32",
19
+ "init_std": 0.02,
20
+ "is_decoder": true,
21
+ "layernorm_embedding": true,
22
+ "max_position_embeddings": 512,
23
+ "model_type": "trocr",
24
+ "scale_embedding": true,
25
+ "tie_word_embeddings": false,
26
+ "use_cache": false,
27
+ "use_learned_position_embeddings": true,
28
+ "vocab_size": 573
29
+ },
30
+ "dtype": "float32",
31
+ "encoder": {
32
+ "attention_probs_dropout_prob": 0.0,
33
+ "dtype": "float32",
34
+ "encoder_stride": 16,
35
+ "hidden_act": "gelu",
36
+ "hidden_dropout_prob": 0.0,
37
+ "hidden_size": 384,
38
+ "image_size": 384,
39
+ "initializer_range": 0.02,
40
+ "intermediate_size": 1536,
41
+ "layer_norm_eps": 1e-12,
42
+ "model_type": "deit",
43
+ "num_attention_heads": 6,
44
+ "num_channels": 3,
45
+ "num_hidden_layers": 12,
46
+ "patch_size": 16,
47
+ "pooler_act": "tanh",
48
+ "pooler_output_size": 384,
49
+ "qkv_bias": true
50
+ },
51
+ "eos_token_id": 2,
52
+ "is_encoder_decoder": true,
53
+ "model_type": "vision-encoder-decoder",
54
+ "tie_word_embeddings": false,
55
+ "transformers_version": "4.57.6"
56
+ }
source-model/character-assets/generation_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "decoder_start_token_id": 2,
5
+ "eos_token_id": 2,
6
+ "max_new_tokens": 257,
7
+ "pad_token_id": 1,
8
+ "suppress_tokens": [
9
+ 0,
10
+ 1,
11
+ 3
12
+ ],
13
+ "transformers_version": "4.57.6",
14
+ "use_cache": false
15
+ }
source-model/character-assets/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
+ }
source-model/character-generation.json ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_length": 20,
3
+ "max_new_tokens": 257,
4
+ "min_length": 0,
5
+ "min_new_tokens": null,
6
+ "early_stopping": false,
7
+ "max_time": null,
8
+ "stop_strings": null,
9
+ "do_sample": false,
10
+ "num_beams": 1,
11
+ "use_cache": false,
12
+ "cache_implementation": null,
13
+ "cache_config": null,
14
+ "return_legacy_cache": null,
15
+ "prefill_chunk_size": null,
16
+ "temperature": 1.0,
17
+ "top_k": 50,
18
+ "top_p": 1.0,
19
+ "min_p": null,
20
+ "typical_p": 1.0,
21
+ "epsilon_cutoff": 0.0,
22
+ "eta_cutoff": 0.0,
23
+ "repetition_penalty": 1.0,
24
+ "encoder_repetition_penalty": 1.0,
25
+ "length_penalty": 1.0,
26
+ "no_repeat_ngram_size": 0,
27
+ "bad_words_ids": null,
28
+ "renormalize_logits": false,
29
+ "forced_bos_token_id": null,
30
+ "forced_eos_token_id": null,
31
+ "remove_invalid_values": false,
32
+ "exponential_decay_length_penalty": null,
33
+ "suppress_tokens": [
34
+ 0,
35
+ 1,
36
+ 3
37
+ ],
38
+ "begin_suppress_tokens": null,
39
+ "sequence_bias": null,
40
+ "token_healing": false,
41
+ "guidance_scale": null,
42
+ "watermarking_config": null,
43
+ "num_return_sequences": 1,
44
+ "output_attentions": false,
45
+ "output_hidden_states": false,
46
+ "output_scores": false,
47
+ "output_logits": null,
48
+ "return_dict_in_generate": false,
49
+ "pad_token_id": 1,
50
+ "bos_token_id": 0,
51
+ "eos_token_id": 2,
52
+ "encoder_no_repeat_ngram_size": 0,
53
+ "decoder_start_token_id": 2,
54
+ "is_assistant": false,
55
+ "num_assistant_tokens": 20,
56
+ "num_assistant_tokens_schedule": "constant",
57
+ "assistant_confidence_threshold": 0.4,
58
+ "prompt_lookup_num_tokens": null,
59
+ "max_matching_ngram_size": null,
60
+ "assistant_early_exit": null,
61
+ "assistant_lookbehind": 10,
62
+ "target_lookbehind": 10,
63
+ "disable_compile": false,
64
+ "low_memory": null,
65
+ "penalty_alpha": null,
66
+ "dola_layers": null,
67
+ "diversity_penalty": 0.0,
68
+ "num_beam_groups": 1,
69
+ "constraints": null,
70
+ "force_words_ids": null,
71
+ "_from_model_config": true,
72
+ "transformers_version": "4.57.6"
73
+ }
source-model/english-assets/README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - trocr
4
+ - image-to-text
5
+ widget:
6
+ - src: https://fki.tic.heia-fr.ch/static/img/a01-122-02.jpg
7
+ example_title: Note 1
8
+ - src: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSoolxi9yWGAT5SLZShv8vVd0bz47UWRzQC19fDTeE8GmGv_Rn-PCF1pP1rrUx8kOjA4gg&usqp=CAU
9
+ example_title: Note 2
10
+ - src: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRNYtTuSBpZPV_nkBYPMFwVVD9asZOPgHww4epu9EqWgDmXW--sE2o8og40ZfDGo87j5w&usqp=CAU
11
+ example_title: Note 3
12
+ ---
13
+
14
+ # TrOCR (small-sized model, fine-tuned on IAM)
15
+
16
+ TrOCR model fine-tuned on the [IAM dataset](https://fki.tic.heia-fr.ch/databases/iam-handwriting-database). It was introduced in the paper [TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models](https://arxiv.org/abs/2109.10282) by Li et al. and first released in [this repository](https://github.com/microsoft/unilm/tree/master/trocr).
17
+
18
+
19
+ ## Model description
20
+
21
+ The TrOCR model is an encoder-decoder model, consisting of an image Transformer as encoder, and a text Transformer as decoder. The image encoder was initialized from the weights of DeiT, while the text decoder was initialized from the weights of UniLM.
22
+
23
+ Images are presented to the model as a sequence of fixed-size patches (resolution 16x16), which are linearly embedded. One also adds absolute position embeddings before feeding the sequence to the layers of the Transformer encoder. Next, the Transformer text decoder autoregressively generates tokens.
24
+
25
+ ## Intended uses & limitations
26
+
27
+ You can use the raw model for optical character recognition (OCR) on single text-line images. See the [model hub](https://huggingface.co/models?search=microsoft/trocr) to look for fine-tuned versions on a task that interests you.
28
+
29
+ ### How to use
30
+
31
+ Here is how to use this model in PyTorch:
32
+
33
+ ```python
34
+ from transformers import TrOCRProcessor, VisionEncoderDecoderModel
35
+ from PIL import Image
36
+ import requests
37
+
38
+ # load image from the IAM database
39
+ url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
40
+ image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
41
+
42
+ processor = TrOCRProcessor.from_pretrained('microsoft/trocr-small-handwritten')
43
+ model = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-small-handwritten')
44
+ pixel_values = processor(images=image, return_tensors="pt").pixel_values
45
+
46
+ generated_ids = model.generate(pixel_values)
47
+ generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
48
+ ```
49
+
50
+ ### BibTeX entry and citation info
51
+
52
+ ```bibtex
53
+ @misc{li2021trocr,
54
+ title={TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models},
55
+ author={Minghao Li and Tengchao Lv and Lei Cui and Yijuan Lu and Dinei Florencio and Cha Zhang and Zhoujun Li and Furu Wei},
56
+ year={2021},
57
+ eprint={2109.10282},
58
+ archivePrefix={arXiv},
59
+ primaryClass={cs.CL}
60
+ }
61
+ ```
source-model/english-assets/config.json ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VisionEncoderDecoderModel"
4
+ ],
5
+ "decoder": {
6
+ "_name_or_path": "",
7
+ "activation_dropout": 0.0,
8
+ "activation_function": "relu",
9
+ "add_cross_attention": true,
10
+ "architectures": null,
11
+ "attention_dropout": 0.0,
12
+ "bad_words_ids": null,
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
+ "diversity_penalty": 0.0,
24
+ "do_sample": false,
25
+ "dropout": 0.1,
26
+ "early_stopping": false,
27
+ "encoder_no_repeat_ngram_size": 0,
28
+ "eos_token_id": 2,
29
+ "finetuning_task": null,
30
+ "forced_bos_token_id": null,
31
+ "forced_eos_token_id": null,
32
+ "id2label": {
33
+ "0": "LABEL_0",
34
+ "1": "LABEL_1"
35
+ },
36
+ "init_std": 0.02,
37
+ "is_decoder": true,
38
+ "is_encoder_decoder": false,
39
+ "label2id": {
40
+ "LABEL_0": 0,
41
+ "LABEL_1": 1
42
+ },
43
+ "layernorm_embedding": true,
44
+ "length_penalty": 1.0,
45
+ "max_length": 20,
46
+ "max_position_embeddings": 512,
47
+ "min_length": 0,
48
+ "model_type": "trocr",
49
+ "no_repeat_ngram_size": 0,
50
+ "num_beam_groups": 1,
51
+ "num_beams": 1,
52
+ "num_return_sequences": 1,
53
+ "output_attentions": false,
54
+ "output_hidden_states": false,
55
+ "output_scores": false,
56
+ "pad_token_id": 1,
57
+ "prefix": null,
58
+ "problem_type": null,
59
+ "pruned_heads": {},
60
+ "remove_invalid_values": false,
61
+ "repetition_penalty": 1.0,
62
+ "return_dict": true,
63
+ "return_dict_in_generate": false,
64
+ "scale_embedding": true,
65
+ "sep_token_id": null,
66
+ "task_specific_params": null,
67
+ "temperature": 1.0,
68
+ "tie_encoder_decoder": false,
69
+ "tie_word_embeddings": false,
70
+ "tokenizer_class": null,
71
+ "top_k": 50,
72
+ "top_p": 1.0,
73
+ "torch_dtype": null,
74
+ "torchscript": false,
75
+ "transformers_version": "4.14.1",
76
+ "use_bfloat16": false,
77
+ "use_cache": false,
78
+ "use_learned_position_embeddings": true,
79
+ "vocab_size": 64044
80
+ },
81
+ "encoder": {
82
+ "_name_or_path": "",
83
+ "add_cross_attention": false,
84
+ "architectures": null,
85
+ "attention_probs_dropout_prob": 0.0,
86
+ "bad_words_ids": null,
87
+ "bos_token_id": null,
88
+ "chunk_size_feed_forward": 0,
89
+ "cross_attention_hidden_size": null,
90
+ "decoder_start_token_id": null,
91
+ "diversity_penalty": 0.0,
92
+ "do_sample": false,
93
+ "early_stopping": false,
94
+ "encoder_no_repeat_ngram_size": 0,
95
+ "eos_token_id": null,
96
+ "finetuning_task": null,
97
+ "forced_bos_token_id": null,
98
+ "forced_eos_token_id": null,
99
+ "hidden_act": "gelu",
100
+ "hidden_dropout_prob": 0.0,
101
+ "hidden_size": 384,
102
+ "id2label": {
103
+ "0": "LABEL_0",
104
+ "1": "LABEL_1"
105
+ },
106
+ "image_size": 384,
107
+ "initializer_range": 0.02,
108
+ "intermediate_size": 1536,
109
+ "is_decoder": false,
110
+ "is_encoder_decoder": false,
111
+ "label2id": {
112
+ "LABEL_0": 0,
113
+ "LABEL_1": 1
114
+ },
115
+ "layer_norm_eps": 1e-12,
116
+ "length_penalty": 1.0,
117
+ "max_length": 20,
118
+ "min_length": 0,
119
+ "model_type": "deit",
120
+ "no_repeat_ngram_size": 0,
121
+ "num_attention_heads": 6,
122
+ "num_beam_groups": 1,
123
+ "num_beams": 1,
124
+ "num_channels": 3,
125
+ "num_hidden_layers": 12,
126
+ "num_return_sequences": 1,
127
+ "output_attentions": false,
128
+ "output_hidden_states": false,
129
+ "output_scores": false,
130
+ "pad_token_id": null,
131
+ "patch_size": 16,
132
+ "prefix": null,
133
+ "problem_type": null,
134
+ "pruned_heads": {},
135
+ "qkv_bias": true,
136
+ "remove_invalid_values": false,
137
+ "repetition_penalty": 1.0,
138
+ "return_dict": true,
139
+ "return_dict_in_generate": false,
140
+ "sep_token_id": null,
141
+ "task_specific_params": null,
142
+ "temperature": 1.0,
143
+ "tie_encoder_decoder": false,
144
+ "tie_word_embeddings": true,
145
+ "tokenizer_class": null,
146
+ "top_k": 50,
147
+ "top_p": 1.0,
148
+ "torch_dtype": null,
149
+ "torchscript": false,
150
+ "transformers_version": "4.14.1",
151
+ "use_bfloat16": false
152
+ },
153
+ "eos_token_id": 2,
154
+ "is_encoder_decoder": true,
155
+ "model_type": "vision-encoder-decoder",
156
+ "tie_word_embeddings": false,
157
+ "torch_dtype": "float32",
158
+ "transformers_version": null
159
+ }
source-model/english-assets/generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "decoder_start_token_id": 2,
5
+ "eos_token_id": 2,
6
+ "pad_token_id": 1,
7
+ "transformers_version": "4.27.0.dev0",
8
+ "use_cache": false
9
+ }