maxffarrell commited on
Commit
0415692
·
verified ·
1 Parent(s): 462e11d

Publish validated AMOS Core AI conversion with source provenance and runtime adapter

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 +37 -0
  2. LICENSE +202 -0
  3. README.md +57 -0
  4. SHA256SUMS +149 -0
  5. SOURCE.json +179 -0
  6. bf16-attempt.json +181 -0
  7. bf16-comparison.json +315 -0
  8. calibration.json +7 -0
  9. config.json +1 -0
  10. convert_decoder.py +49 -0
  11. convert_medium_sharded.py +54 -0
  12. coreai_decoder.py +100 -0
  13. embedding.aimodel/main.hash +1 -0
  14. embedding.aimodel/main.mlirb +3 -0
  15. embedding.aimodel/metadata.json +5 -0
  16. finish.aimodel/main.hash +1 -0
  17. finish.aimodel/main.mlirb +3 -0
  18. finish.aimodel/metadata.json +5 -0
  19. heads.aimodel/main.hash +1 -0
  20. heads.aimodel/main.mlirb +3 -0
  21. heads.aimodel/metadata.json +5 -0
  22. layer-00.aimodel/main.hash +1 -0
  23. layer-00.aimodel/main.mlirb +3 -0
  24. layer-00.aimodel/metadata.json +5 -0
  25. layer-01.aimodel/main.hash +1 -0
  26. layer-01.aimodel/main.mlirb +3 -0
  27. layer-01.aimodel/metadata.json +5 -0
  28. layer-02.aimodel/main.hash +1 -0
  29. layer-02.aimodel/main.mlirb +3 -0
  30. layer-02.aimodel/metadata.json +5 -0
  31. layer-03.aimodel/main.hash +1 -0
  32. layer-03.aimodel/main.mlirb +3 -0
  33. layer-03.aimodel/metadata.json +5 -0
  34. layer-04.aimodel/main.hash +1 -0
  35. layer-04.aimodel/main.mlirb +3 -0
  36. layer-04.aimodel/metadata.json +5 -0
  37. layer-05.aimodel/main.hash +1 -0
  38. layer-05.aimodel/main.mlirb +3 -0
  39. layer-05.aimodel/metadata.json +5 -0
  40. layer-06.aimodel/main.hash +1 -0
  41. layer-06.aimodel/main.mlirb +3 -0
  42. layer-06.aimodel/metadata.json +5 -0
  43. layer-07.aimodel/main.hash +1 -0
  44. layer-07.aimodel/main.mlirb +3 -0
  45. layer-07.aimodel/metadata.json +5 -0
  46. layer-08.aimodel/main.hash +2 -0
  47. layer-08.aimodel/main.mlirb +3 -0
  48. layer-08.aimodel/metadata.json +5 -0
  49. layer-09.aimodel/main.hash +0 -0
  50. layer-09.aimodel/main.mlirb +3 -0
.gitattributes CHANGED
@@ -33,3 +33,40 @@ saved_model/**/* 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
+ embedding.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
37
+ finish.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
38
+ heads.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
39
+ layer-00.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
40
+ layer-01.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
41
+ layer-02.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
42
+ layer-03.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
43
+ layer-04.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
44
+ layer-05.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
45
+ layer-06.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
46
+ layer-07.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
47
+ layer-08.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
48
+ layer-09.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
49
+ layer-10.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
50
+ layer-11.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
51
+ layer-12.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
52
+ layer-13.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
53
+ layer-14.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
54
+ layer-15.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
55
+ layer-16.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
56
+ layer-17.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
57
+ layer-18.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
58
+ layer-19.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
59
+ layer-20.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
60
+ layer-21.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
61
+ layer-22.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
62
+ layer-23.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
63
+ layer-24.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
64
+ layer-25.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
65
+ layer-26.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
66
+ layer-27.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
67
+ layer-28.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
68
+ layer-29.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
69
+ layer-30.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
70
+ layer-31.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
71
+ model/tokenizer.json filter=lfs diff=lfs merge=lfs -text
72
+ vision.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: mukaddamzaid/amos-1-medium
4
+ tags: [coreai, core-ai, apple, aimodel, decisions, vision]
5
+ ---
6
+
7
+ # amos-1-medium — Apple Core AI
8
+
9
+ Independent AMOS-1 conversion with its checkpoint's **causal full attention** preserved. Text backbone, 255-code readout, vision tower, span head, region head and trained box head execute through Core AI. Original prompt formatting, temperatures and quote decoding are retained. This is a decision model, not a text generator.
10
+
11
+ ## Use
12
+
13
+ Requires macOS 27 and the Core AI Python runtime. Tested with `coreai-torch==0.4.3`, PyTorch 2.14.0, Transformers 5.19 development, NumPy and Pillow. Exact dependencies are in `requirements.txt`. The converter warns that this PyTorch version exceeds its validated range. Host preprocessing/decoding uses PyTorch tensors; it loads no PyTorch neural weights.
14
+
15
+ ```python
16
+ import asyncio
17
+ from coreai_decoder import AmosDecoder
18
+
19
+ async def main():
20
+ m = await AmosDecoder.load(".")
21
+ print(await m.request({
22
+ "state": "Please refund the duplicate charge.",
23
+ "questions": {"refund": {
24
+ "type": "noul", "instructions": "Is a refund requested?"
25
+ }}
26
+ }))
27
+
28
+ asyncio.run(main())
29
+ ```
30
+
31
+ `predict(state, questions, images=())` takes upstream internal questions (`text`, `options`) and PIL images, including image options. `request()` takes base64 images in the original AMOS format.
32
+
33
+ ## Verified scope and limits
34
+
35
+ Batch one, **512 combined tokens**, 224×224 images (49 merged tokens), float32 backbone/vision weights with FP32 readout and heads. Requests over capacity raise an error. Original longer contexts, variable image resolution, wide-choice two-pass routing, rotations, thinking, hosted server and explanation endpoints are not implemented. Up to 255 option codes are available subject to token capacity. No iPhone, Neural Engine placement, throughput or upstream benchmark accuracy claim has been verified. Core AI uses default specialization.
36
+
37
+ The text graph is split into an embedding asset, 32 transformer-layer assets and a final normalization/readout asset. They execute sequentially through Core AI in FP32. Conversion and the independent reference expand only one layer at a time. Gated-delta attention uses functional forward substitution instead of the export-only inverse construction; this matches the original eager triangular solve. The replacement passed 21 independent randomized comparisons and was checked against intermediate outputs from the trained model. Tested on a 64 GiB Mac; no smaller-memory device has been verified.
38
+
39
+ Nine smoke/parity cases cover all six typed question kinds, quote extraction, Unicode, 24 options, synthetic state images and image options. Tested discrete decisions matched upstream. Maximum measured probability/box-coordinate error: **0.00001425**. Full results are in `validation.json`; these smoke cases do not establish benchmark accuracy. `runtime-smoke.json` verifies inference with PyTorch neural execution disabled.
40
+
41
+ The primary parity reference executes the pinned checkpoint in FP32. Compared with the original BF16 serving path in 9 additional cases, maximum probability/box error was 0.109300, and 1 cases changed a discrete output. Region confidence can change discontinuously when a box crosses a grid boundary. See `bf16-comparison.json`; this is not bit-identical BF16 serving.
42
+
43
+ ## Attribution and reproducibility
44
+
45
+ Original model and serving code: Zaid Mukaddam, [mukaddamzaid/amos-1-medium](https://huggingface.co/mukaddamzaid/amos-1-medium). Weights derive from Qwen3.5. Apache-2.0 applies; see `LICENSE` and `SOURCE.json` for the pinned AMOS revision and source hashes. Conversion adds no restrictions. Upstream serving sources are included under `serve/`.
46
+
47
+ Download the pinned source and reproduce from a directory holding these scripts:
48
+
49
+ ```bash
50
+ hf download mukaddamzaid/amos-1-medium --revision 6b48a91ed940e08c87dcdd29c71c3b256d757ec7 --local-dir upstream/amos-1-medium
51
+ python convert_medium_sharded.py
52
+ python validate_decoder.py amos-1-medium --mode reference
53
+ python validate_decoder.py amos-1-medium --mode coreai
54
+ python smoke_decoder.py amos-1-medium
55
+ ```
56
+
57
+ The two validation processes keep the reference model and Core AI runtime out of memory at the same time. Release integrity is recorded in `SHA256SUMS`.
SHA256SUMS ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
2
+ a4ba5662de53a69d4aeb035ec818ede0facd61b523040dac025f61c2cf68db83 README.md
3
+ 59baf0b50bf8d6b1b8f7be5f29827a0649d1d23a6510856a7e85d23ef00086c8 SOURCE.json
4
+ e43486a0a8ef7a9b042ba95d83086baad5f5b6ecff194d7ab18f581840fb75bd bf16-attempt.json
5
+ e89fae9a7630a27a408f2b48acdaf75aebe017957c815654f934769773f10f5c bf16-comparison.json
6
+ 4a7251b59a4edd324c1063baf454f2b3a3176a7d678b296f19452cd1d45c46ea calibration.json
7
+ b705e46d554298420a89287499d84d93ebb50675dd61a42d8752350754beb2c9 config.json
8
+ 910e2baa29daa433c9dbf4120c4848da3898d94ff8a0d899e82484308690d347 convert_decoder.py
9
+ e457409e42e9a5b7dbe12a53180a045239012170ad4481b79536c839fb83f8d2 convert_medium_sharded.py
10
+ 94db146d96f60709905396f59e6009c76d39a63f8e2e9796406fa3a5611a4e3a coreai_decoder.py
11
+ 59d4b07cdcb63aadf6f33369f703e7cd963d9b8ad7c6ad7a7f6f03dc8e2fd2b3 embedding.aimodel/main.hash
12
+ 6fcec91d2cdc76e76a855ccc7dc61d10697852772f81b6d7a8d94af4ac897407 embedding.aimodel/main.mlirb
13
+ 1a76f7272568c5a7dfd5a7425023d01ce2b641b090168120c3390e9f29ae3f29 embedding.aimodel/metadata.json
14
+ 6374a4ca1aa66476a2b447a95ba409a857fffac7c2a2462716e345372d392019 finish.aimodel/main.hash
15
+ 40ed1efe47f26cc15794ce7616798dd2f948207262fd62041b6961e381f37c15 finish.aimodel/main.mlirb
16
+ c57af257edcf0598c4a9c744ad72e067eb44ea638c5fcd374d89e7d1b1ae3773 finish.aimodel/metadata.json
17
+ 30985aab978011567a406cbb997d76adaa4ca35fea8076de85b3177e721f1f09 heads.aimodel/main.hash
18
+ 455361e9ff9557669def5344f8db6872e1bdcddc81e41141c5888cce54197f27 heads.aimodel/main.mlirb
19
+ 447ac46fb7493976509699118d00e61ab2c13f50eb0692797210e4dcd10e410f heads.aimodel/metadata.json
20
+ a88d1d17ababbcacbcc09029d691734118b42ae394e19b18034286681430ca2e layer-00.aimodel/main.hash
21
+ b506c0c52bdffe5dc796662ea73c92c2612ee4dc775b226ec60110b93594c740 layer-00.aimodel/main.mlirb
22
+ c1d58f995410e5c18525f3e7ffd65e37b2f997f9c190efe7ba918be75bec9cbd layer-00.aimodel/metadata.json
23
+ f3016c678777a8b94fc725ed16925ce0a52a900b3eab54e258ba93b3f72997f9 layer-01.aimodel/main.hash
24
+ 3656fc65add337eb97637dd47f3421d082f8d11ba555f753dddd24068ce732c1 layer-01.aimodel/main.mlirb
25
+ a121c2080592caf2e9ed3f1225f979d7d638c3fe2349b702970858aca6dc7c60 layer-01.aimodel/metadata.json
26
+ a0b5be4c51ba958a9de19be9d87312363ae04f29e8e0de2d5d7dbd096aa21f6d layer-02.aimodel/main.hash
27
+ 4261515422e07c5f633a4a8436fdd724d768694023941be5f8fed0a6c7ce7ef2 layer-02.aimodel/main.mlirb
28
+ cce09e3c5e3173f26940c3330cb09f89c8b148de6910a9005c2ce8cd4188f9ec layer-02.aimodel/metadata.json
29
+ d614c642d099d22e18c6621acc654b06d70e6641d11d48fe1a124b459f00e71f layer-03.aimodel/main.hash
30
+ 40b6b0de27b454661002405a4921d3a8a88e0efabdadc45add9d68abe322a135 layer-03.aimodel/main.mlirb
31
+ b7777c03d2a2898d08430335f9edf0729db5c3942ee6464079948a35406a03ea layer-03.aimodel/metadata.json
32
+ 57d92f10bad48b9c74c7b750b06922abcffdc8ea4b531d18d0b21a95a0448ce8 layer-04.aimodel/main.hash
33
+ cbf1ad7ff01a89c1aebf1693e059676cff6a7a3219feee2a49237a1aba83b856 layer-04.aimodel/main.mlirb
34
+ d5d59d36e35e40ad826f533dbbba26475586ce8ba6175eb655c1f5fa993086bf layer-04.aimodel/metadata.json
35
+ fa1799bf1c3d6e0697a853ba9393da65cdce1ca7ef21b17493a20a63d8ea7697 layer-05.aimodel/main.hash
36
+ e8ba384095287e7d9f4bd0aa05b34dad6feca189a7f32fae5a5659b86d1b34e2 layer-05.aimodel/main.mlirb
37
+ f516ea4680a1a18a56dcb7ed46fa71c5df32207fbdd0796a20939163f49f796e layer-05.aimodel/metadata.json
38
+ 4afdf63fe5543438c374444f98cb895c0a3394ba064be75c46323ef53ef04962 layer-06.aimodel/main.hash
39
+ a15792d07af6107986f80e3cf495be519d976d4ee64bb110fabb4d6e1ba959d8 layer-06.aimodel/main.mlirb
40
+ f044e22a815d45b3dfb4e76e888a23be99c444f9f0f2abad7e4ca674088913a1 layer-06.aimodel/metadata.json
41
+ ac6f040a6bbd7762ca462bbe262dd6ca92e2e8d2fb5cab550eca013c77e950cb layer-07.aimodel/main.hash
42
+ d1ad7434add3c0c3d4effdd2f98f5a3fef4d14372b2c1fe21e8bbd93b1d78d65 layer-07.aimodel/main.mlirb
43
+ b4eadb01163b3b27ae3400b2a6f3b6ee90455e90f32d8b3a509454701fc790dc layer-07.aimodel/metadata.json
44
+ 8a170b0127d3dcf84fff6ecb4aef3447b003670ae12be547c67d4717d465783f layer-08.aimodel/main.hash
45
+ c7bffc69c084785234be0faa61a38d4d4f77c1aa1630bb9be44950160ad8f70e layer-08.aimodel/main.mlirb
46
+ bc59d87615bc2623beea3a1a059aba9ee025e9a9d42cb6648bffb3b877879d2e layer-08.aimodel/metadata.json
47
+ 0291d32e7b16b17c760febda7e4c6156211409aa19e751d7a3f0d7e783e5e879 layer-09.aimodel/main.hash
48
+ 3f7401a15775cd13ac01a5000bbfb55e2aaba194d2e7315540d09b9c66fcbaea layer-09.aimodel/main.mlirb
49
+ 1fe1ef0ad0fdd11349d12fcfe5283d1e127f2f259ca9d39843f45e11239b97d6 layer-09.aimodel/metadata.json
50
+ 9b20226b17789582b12a77891a5e933ce6cd0a65c5c01318c121babd14cd867a layer-10.aimodel/main.hash
51
+ be8f740a5edf5284760fe1f17be01c99171015509266209c3f6f2f4d6d566918 layer-10.aimodel/main.mlirb
52
+ 0a2e591e6bdc41f19e7a5375f742349e1b252457e9224918c816e7ac5ef6d8ff layer-10.aimodel/metadata.json
53
+ 089c57c5f2770ce3629ff2f21b3cf88370d00afba9fc662992a336e7309c3e02 layer-11.aimodel/main.hash
54
+ d97200be31b02ab0c92e9fc1ea7ab834e1377773d4ff589100db9077a60b024f layer-11.aimodel/main.mlirb
55
+ 9004cd907a3b6a871a48c87dffed53fa6d7af2fe045bdb1cdb68099da267a541 layer-11.aimodel/metadata.json
56
+ 4e327cd93d97b8112472a7b76811da8fe21357a6a7c3bb4e5e9d3ed2f07b37dd layer-12.aimodel/main.hash
57
+ ed3314c6de83daa4f9671bb03dcb11e480556e352e7f0aec26adbed7044711f1 layer-12.aimodel/main.mlirb
58
+ 793fc185515dd7b0fd6f1cd1b04915cbf58d41d35b5d9fa756ef74de616c53dc layer-12.aimodel/metadata.json
59
+ 29e2babc319322b48dcf2f93ed02894d2dfbf405c3fbabac052154920930beb3 layer-13.aimodel/main.hash
60
+ ae258a478059967a8d7d4321ab6e7e3d940492456f4d3f1213dd76a9cd6642e3 layer-13.aimodel/main.mlirb
61
+ a3d53f031431a823840bd5440bd0f9cc63aafda3aa99c415dcaa307a7663b906 layer-13.aimodel/metadata.json
62
+ a88fd2368f838be967b1423de44bd694ec945cfd427eddb5a629026558bbcffd layer-14.aimodel/main.hash
63
+ 16716737712bb9ace2958ee507ee4fc067746ef4c08835d61ff8a2e41519f60a layer-14.aimodel/main.mlirb
64
+ c3d9f7797644be0384370bf37f3a90a2f8edb13e86b608cef1434c3085e6bc8d layer-14.aimodel/metadata.json
65
+ 980baeb810e5e1e87ed7e1f13fc1e8e37c7614913ad2330986ec2cff6e62c39e layer-15.aimodel/main.hash
66
+ 36656b20507894cfa3ef07e529c9fb9732420985d05e27484d2a91d2b8c1b1eb layer-15.aimodel/main.mlirb
67
+ 4e2d389e81252fb07306c602ece123dfb0338c5c22b15b1177148494937fc31a layer-15.aimodel/metadata.json
68
+ cbf7c01dbd356c9e6f9cc7cb0d31d0106fc50fc609045a72ce921ada6ebf3573 layer-16.aimodel/main.hash
69
+ 6863d7b56af2cc67a2d492425b4b6e4da3717fec0849b02049a33a6afa93ac4d layer-16.aimodel/main.mlirb
70
+ 1984518024c16eda5d5da35c2f6d9df2db00214c2884b2c32eda675567249134 layer-16.aimodel/metadata.json
71
+ 3e95bfe3a4e66790f9068b73dce6f93d6b1f8b26cd6660c82267eccb0efb1e93 layer-17.aimodel/main.hash
72
+ 80d069228ee3bca6a408568637ebc57ff65a16830087681e492ef4155c000651 layer-17.aimodel/main.mlirb
73
+ b144c2f42cf676f93f554ccf5f2366f0efdd449416a1c40a7b2510b504a9c554 layer-17.aimodel/metadata.json
74
+ e0a16e1351e0819e6696cf7c6a5a661d14178c224b0e9977c80eca4ddfb5c5d0 layer-18.aimodel/main.hash
75
+ 94e53f7086b760e0ac860a89b7c53ce161c3990c4bc97517a2de83398ff60507 layer-18.aimodel/main.mlirb
76
+ 6629be3f16b78c283997d635b90fb3f8985f172bd8d2c62d16408d8852636167 layer-18.aimodel/metadata.json
77
+ 77d378b15a4bda2ba709e395d30057aed2a1e48a62ea5b2257d88e13a6a6c70b layer-19.aimodel/main.hash
78
+ 8cec2a63e5ca8e9c3a88929dc4867efa993a6e9b012b8e44aa8eb8fa7fcf148b layer-19.aimodel/main.mlirb
79
+ 806fc243d9d6adeec45461f0c474346d60616ca7caacbf6b6a4c114f106d2b56 layer-19.aimodel/metadata.json
80
+ 56cba7775b52b4394db21860f9b04d3caa78bd11fc08c08e41855a734f3967d6 layer-20.aimodel/main.hash
81
+ e42fc846ef06126b880ec69d6d25ad83dd5e4813fca4f51695271bf1b142b797 layer-20.aimodel/main.mlirb
82
+ 79bdaeeaf3b24bcc08e29514e4bd18a57c5f7041cc683bda67260fa14d1fc350 layer-20.aimodel/metadata.json
83
+ b44638150943c03bd87a2b2ec3a57334fe43f9981cfca90fd9346a343cb01626 layer-21.aimodel/main.hash
84
+ 0f1dfc2393dbfcfa0129ad965dd7c2fc4d4ac7ddcf9ce25ea68501fa5aeb7df7 layer-21.aimodel/main.mlirb
85
+ f5b3cc44231a7f5a51c1d45b8bb254d92bf37d2e2111b0c8cde5ab9383eeaadd layer-21.aimodel/metadata.json
86
+ 3773f20fae795a15f4835282945e2a7b1e71cb40aa1ea5f1e7ad39553c596e0e layer-22.aimodel/main.hash
87
+ 8e35f9ef221fee278b0e7df2ac3e4643bfb77ae3644c786f9ed003ee9c10a30f layer-22.aimodel/main.mlirb
88
+ f1b8f1e895dc4c5bf4882c0503367d08af0f40de7e5126bb52b3f13a2c7f6bcc layer-22.aimodel/metadata.json
89
+ 7c103be39bfb6424157fb8e1029bb3f9020f439355b9f6401356ce5542eb4e94 layer-23.aimodel/main.hash
90
+ 2b58ef90e64fe06fe3b2127eee0705331f0b307a686f21f99ac9a4e6cf955abe layer-23.aimodel/main.mlirb
91
+ 5d33a18d46fb436783b5982c5901fc2a43e51dac183cae6a957d7419cdd9aa7d layer-23.aimodel/metadata.json
92
+ aa1ba06e01059f78007a29fd70ad83dfe6386276b65330d5b03361fed3b66ab0 layer-24.aimodel/main.hash
93
+ dfb66edc24171137f37516602a90c143b966f0a74e7f78ed81a30b9bd0257a89 layer-24.aimodel/main.mlirb
94
+ 2a840be3ffde9943847dae58a22e8a29a2a101bc5cf96b4f8f588626a3d9ecfa layer-24.aimodel/metadata.json
95
+ b47a9310bfd8517228d4dfef1f87abc1fec3c315fb74b0e04522bd7d66efc180 layer-25.aimodel/main.hash
96
+ 8a376d08635b27688c04e11be678087cb6fe7733362266163c749e717bb6b6e2 layer-25.aimodel/main.mlirb
97
+ 2e3c6c4ee2812522d020c49f7bd23aac2b1c3ef84a77552c390a87e9cb310083 layer-25.aimodel/metadata.json
98
+ d33e996542edc6fde1b11516269a2afcad4c70f97670c2b7722fb598b936be3d layer-26.aimodel/main.hash
99
+ f11e92ad47e77a9ce11c30eb50ac2c7a09d3abc0c2c0320cfebb78bcca56d1c3 layer-26.aimodel/main.mlirb
100
+ 4dc937db892b7b857554843057e7afc8a1c3e2da20d593e4e65e91d861f06f9f layer-26.aimodel/metadata.json
101
+ c79db0f7a82074c555bc2d56f9678af3628e1ea73dbe01253f9c6609a52e6998 layer-27.aimodel/main.hash
102
+ 2bf14a05dbb7cdb6f734b7664a5e2b74a477f9f67ca77ca9d0c4ffb4e00184cd layer-27.aimodel/main.mlirb
103
+ 70c87704121140dbc66be29d6e24396f2ca2b30557736c5c7fb6d13e5e78c196 layer-27.aimodel/metadata.json
104
+ 7ac711aa4daaced37b16a4c03c75f55af895c36352b2e779ad4e8f2475bc12ca layer-28.aimodel/main.hash
105
+ 0f3e200196185e3dcb0125ef0d3524a5ce93143e226f6ea357b790347baf5c0b layer-28.aimodel/main.mlirb
106
+ 5f376729867494509a7f2dcdb5a035166bf579a11f3b64d7428fdfc6fd52fb5a layer-28.aimodel/metadata.json
107
+ 2ee93cf261591e0ea8344cdb81aaf05d21490c874b032ed8c557ff3f74ae5600 layer-29.aimodel/main.hash
108
+ fbca7a309b0090b05e5df56eab1cd7cff96019f08453d23f5ab476bf2f4b6069 layer-29.aimodel/main.mlirb
109
+ ba90bbe1fadf75ea129bd02fea88b0a92ab624693bcc9026f8a4f2454ed14eb4 layer-29.aimodel/metadata.json
110
+ 9ddd0265026c9be5eac4b69db185bc02a05f088509378402245ce7d5b9739a17 layer-30.aimodel/main.hash
111
+ 8f0c2d9df134e7721b8a7d819be51c0621803a47eb27a738ad75192f04c4c3aa layer-30.aimodel/main.mlirb
112
+ f787b4af5978daf5beb93a4dcd60389078ce52f5e9e65872e061e73230bc55ae layer-30.aimodel/metadata.json
113
+ 281ffa534596df7a7ba4838eb8de4e57bf60e8a27f2df5a402a4e89b9720e21a layer-31.aimodel/main.hash
114
+ bd1e995c957256ffd8ae6e46e045f74446aaad41d92bf2d87b8e6d1c41d21f10 layer-31.aimodel/main.mlirb
115
+ c57af257edcf0598c4a9c744ad72e067eb44ea638c5fcd374d89e7d1b1ae3773 layer-31.aimodel/metadata.json
116
+ c082cbd02da0ebaba873d44dc15c14305ee3b7c9e6944f01ec75fa913ca9ffae manifest.json
117
+ a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715 model/chat_template.jinja
118
+ b647a20915503035f0e9a906980b891567bc04085fde26759016a05bf4445227 model/config.json
119
+ 62153eb6c69f2e1f426beaa8002b7186437e949c7588167085df14e10e9c0a73 model/generation_config.json
120
+ 27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516 model/preprocessor_config.json
121
+ aa7582a6b90dc3711049d293d985e549f2b22c0c4e5ad11b9272a03c6294886e model/tokenizer.json
122
+ 13ef66b39ff28a4bb50d8aaf554dbd01315b4497136b93111e5021ac6396db0f model/tokenizer_config.json
123
+ 7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13 model/video_preprocessor_config.json
124
+ d7910a3390f8073d95908f3301c0ea0e2df4551699546430003bc8226373c2bc qwen_export_helpers.py
125
+ 52cf5a65b92ffade3534ee62e66a12ca7071bbe6de2429eb64111c95ae861f21 reference.json
126
+ d4e1bf42e2598b84d5800323fdec87fbf338613e8e866e6bb5ce11ed628c8cb2 requirements.txt
127
+ 7337ff08fd8f599bcceef33f7a76fc56c49d23196e1fa06778b9cbb330929ac5 runtime-smoke.json
128
+ 9e17531efd289cf720a36688d943197f9baf9db7c4f743aa4951f6b6f7dbafda serve/README.md
129
+ 0579eb845ee7af463ec88cf627d99dd636466f2c12d840a7cbe183d8f17044fd serve/amos/__init__.py
130
+ ba094d9eaedd229a99b2bdcd35a371ffdeb9aaee258a342524cc19e2f85ec421 serve/amos/calibrate.py
131
+ 0dcacb27a05d31781f8310cbe6123b0ee351c62456cc6b5f8576b40b8ddad080 serve/amos/decoder.py
132
+ b4a5a606a2dee99eedf86cab50be759eca0908a318e4f3037ba92560d837bd67 serve/amos/encoder.py
133
+ f2efd7ef25453f7f2dc204dd247c86733a55697ec48714f30560df8ed2da1f23 serve/amos/facts.py
134
+ d4f4354f3e4d3b475b4c1f832a4a9741da757a368a1d2e0e74544d06009c2c27 serve/amos/model.py
135
+ 14f027c9e15c456abb0f264c07dae06afb7ace7b64270f2374e97eabeb04f993 serve/amos/packing.py
136
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 serve/amos/py.typed
137
+ b0523591c320a074a0ec0751b68ebc205aeedd090ff5e7ca10bda3fb94a07ef8 serve/amos/serve.py
138
+ 133d1e29cc64e371f5df1f0cb0328fd77b8b9093d8465319580cf5ea4af5d081 serve/amos/vision.py
139
+ bea3f98882a5d12c891aae4a5d75eda8c5a5436e88889d94b6a7d3d648d126f2 serve/pyproject.toml
140
+ 0d43aa4e58fe6131f4ed1f4bbcbcaa4a0815f8b1fe5331c7e96489700681136b serve/sources.json
141
+ b9ab562bd0e3f3dd74882b1fe7fd86268c09c75db77a984f56446c21f770b978 smoke_decoder.py
142
+ 39ff61a4f617156941750bfa8dd8aa024a0becb2ac756ac9aa23eecda6b93c6f stable-delta-validation.json
143
+ 32e5eb172f5386f78314ff2db700a443ba2ddd5c805487f540fb87e4bd457264 stable_delta.py
144
+ 439b0b8637dd62f3df5f4f0047ed198048c865beefb075f3374c7dfb9d98da68 validate_decoder.py
145
+ b59443aa0b8dacaaa64dc7c8eabf9aee30c01ca78435c0ddb0cda5e15231af54 validate_stable_delta.py
146
+ dd8e385cdbeaea173fe02e9cfd0d5149d20be9e217225df722bcbf1f74f2f5a7 validation.json
147
+ 6eda4eb2dc9e8b70c5f44cf3db16c979102043ac04951d6bec07e42ca93e2351 vision.aimodel/main.hash
148
+ 86679770f2901e1b4b75d10172924f510621b352fed8db9e8241bd1a2992d068 vision.aimodel/main.mlirb
149
+ f1f79a62132c7a424567bded352478dbe872d8bf92b344866474919f8ee88126 vision.aimodel/metadata.json
SOURCE.json ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "repo": "mukaddamzaid/amos-1-medium",
3
+ "revision": "6b48a91ed940e08c87dcdd29c71c3b256d757ec7",
4
+ "bytes": 19259546893,
5
+ "files": [
6
+ {
7
+ "path": ".gitattributes",
8
+ "size": 1637,
9
+ "lfs": null
10
+ },
11
+ {
12
+ "path": "LICENSE",
13
+ "size": 11358,
14
+ "lfs": null
15
+ },
16
+ {
17
+ "path": "README.md",
18
+ "size": 4427,
19
+ "lfs": null
20
+ },
21
+ {
22
+ "path": "assets/amos-1-medium.png",
23
+ "size": 120578,
24
+ "lfs": {
25
+ "size": 120578,
26
+ "sha256": "b361e10452312a27c9e2a3238455961f5060a12a6310dd8f32cc6575e9ec0388",
27
+ "pointer_size": 131
28
+ }
29
+ },
30
+ {
31
+ "path": "calibration.json",
32
+ "size": 216,
33
+ "lfs": null
34
+ },
35
+ {
36
+ "path": "config.json",
37
+ "size": 28,
38
+ "lfs": null
39
+ },
40
+ {
41
+ "path": "model/chat_template.jinja",
42
+ "size": 7756,
43
+ "lfs": null
44
+ },
45
+ {
46
+ "path": "model/config.json",
47
+ "size": 2877,
48
+ "lfs": null
49
+ },
50
+ {
51
+ "path": "model/generation_config.json",
52
+ "size": 116,
53
+ "lfs": null
54
+ },
55
+ {
56
+ "path": "model/heads.pt",
57
+ "size": 419551003,
58
+ "lfs": {
59
+ "size": 419551003,
60
+ "sha256": "5f38629976dc15322e24d3dfb6e48d918d5548c887739084eafef3c4671e3de6",
61
+ "pointer_size": 134
62
+ }
63
+ },
64
+ {
65
+ "path": "model/model.safetensors",
66
+ "size": 18819722392,
67
+ "lfs": {
68
+ "size": 18819722392,
69
+ "sha256": "4733fa24fd633dadd4f26e941b129ba7c607fdad278f4e2b2ad231b28a51572a",
70
+ "pointer_size": 136
71
+ }
72
+ },
73
+ {
74
+ "path": "model/preprocessor_config.json",
75
+ "size": 390,
76
+ "lfs": null
77
+ },
78
+ {
79
+ "path": "model/tokenizer.json",
80
+ "size": 19989510,
81
+ "lfs": {
82
+ "size": 19989510,
83
+ "sha256": "aa7582a6b90dc3711049d293d985e549f2b22c0c4e5ad11b9272a03c6294886e",
84
+ "pointer_size": 133
85
+ }
86
+ },
87
+ {
88
+ "path": "model/tokenizer_config.json",
89
+ "size": 1173,
90
+ "lfs": null
91
+ },
92
+ {
93
+ "path": "model/video_preprocessor_config.json",
94
+ "size": 385,
95
+ "lfs": null
96
+ },
97
+ {
98
+ "path": "serve/README.md",
99
+ "size": 2505,
100
+ "lfs": null
101
+ },
102
+ {
103
+ "path": "serve/amos/__init__.py",
104
+ "size": 42,
105
+ "lfs": null
106
+ },
107
+ {
108
+ "path": "serve/amos/calibrate.py",
109
+ "size": 1712,
110
+ "lfs": null
111
+ },
112
+ {
113
+ "path": "serve/amos/decoder.py",
114
+ "size": 43439,
115
+ "lfs": null
116
+ },
117
+ {
118
+ "path": "serve/amos/encoder.py",
119
+ "size": 7816,
120
+ "lfs": null
121
+ },
122
+ {
123
+ "path": "serve/amos/facts.py",
124
+ "size": 1356,
125
+ "lfs": null
126
+ },
127
+ {
128
+ "path": "serve/amos/model.py",
129
+ "size": 15106,
130
+ "lfs": null
131
+ },
132
+ {
133
+ "path": "serve/amos/packing.py",
134
+ "size": 10835,
135
+ "lfs": null
136
+ },
137
+ {
138
+ "path": "serve/amos/py.typed",
139
+ "size": 0,
140
+ "lfs": null
141
+ },
142
+ {
143
+ "path": "serve/amos/serve.py",
144
+ "size": 39697,
145
+ "lfs": null
146
+ },
147
+ {
148
+ "path": "serve/amos/vision.py",
149
+ "size": 6633,
150
+ "lfs": null
151
+ },
152
+ {
153
+ "path": "serve/pyproject.toml",
154
+ "size": 842,
155
+ "lfs": null
156
+ },
157
+ {
158
+ "path": "serve/sources.json",
159
+ "size": 1723,
160
+ "lfs": null
161
+ },
162
+ {
163
+ "path": "typed_decisions.json",
164
+ "size": 1341,
165
+ "lfs": null
166
+ }
167
+ ],
168
+ "local_source_hashes": {
169
+ "model/model.safetensors": "4733fa24fd633dadd4f26e941b129ba7c607fdad278f4e2b2ad231b28a51572a",
170
+ "model/tokenizer_config.json": "13ef66b39ff28a4bb50d8aaf554dbd01315b4497136b93111e5021ac6396db0f",
171
+ "model/config.json": "b647a20915503035f0e9a906980b891567bc04085fde26759016a05bf4445227",
172
+ "model/tokenizer.json": "aa7582a6b90dc3711049d293d985e549f2b22c0c4e5ad11b9272a03c6294886e",
173
+ "model/heads.pt": "5f38629976dc15322e24d3dfb6e48d918d5548c887739084eafef3c4671e3de6",
174
+ "model/generation_config.json": "62153eb6c69f2e1f426beaa8002b7186437e949c7588167085df14e10e9c0a73",
175
+ "model/chat_template.jinja": "a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715",
176
+ "model/video_preprocessor_config.json": "7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13",
177
+ "model/preprocessor_config.json": "27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516"
178
+ }
179
+ }
bf16-attempt.json ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "case": "refund",
4
+ "tokens": 122,
5
+ "reference_precision": "bfloat16",
6
+ "upstream": [
7
+ {
8
+ "type": "noul",
9
+ "p_yes": 0.9697602987289429
10
+ },
11
+ {
12
+ "type": "choice",
13
+ "probs": [
14
+ 0.9355213642120361,
15
+ 0.02544301003217697,
16
+ 0.03903552144765854
17
+ ],
18
+ "choice": 0
19
+ }
20
+ ]
21
+ },
22
+ {
23
+ "case": "span",
24
+ "tokens": 123,
25
+ "reference_precision": "bfloat16",
26
+ "upstream": [
27
+ {
28
+ "type": "span",
29
+ "start": 55,
30
+ "end": 63,
31
+ "text": "INV-2231",
32
+ "p": 1.0
33
+ }
34
+ ]
35
+ },
36
+ {
37
+ "case": "score",
38
+ "tokens": 98,
39
+ "reference_precision": "bfloat16",
40
+ "upstream": [
41
+ {
42
+ "type": "score",
43
+ "probs": [
44
+ 0.01346411369740963,
45
+ 0.021021094173192978,
46
+ 0.13800419867038727,
47
+ 0.8275105953216553
48
+ ],
49
+ "choice": 3,
50
+ "expected": 2.7795612774789333
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "case": "multi",
56
+ "tokens": 144,
57
+ "reference_precision": "bfloat16",
58
+ "upstream": [
59
+ {
60
+ "type": "multi",
61
+ "probs": [
62
+ 0.961353600025177,
63
+ 0.9255949854850769,
64
+ 0.05097513645887375
65
+ ]
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "case": "negative",
71
+ "tokens": 83,
72
+ "reference_precision": "bfloat16",
73
+ "upstream": [
74
+ {
75
+ "type": "noul",
76
+ "p_yes": 0.037488047033548355
77
+ }
78
+ ]
79
+ },
80
+ {
81
+ "case": "unicode",
82
+ "tokens": 128,
83
+ "reference_precision": "bfloat16",
84
+ "upstream": [
85
+ {
86
+ "type": "span",
87
+ "start": 10,
88
+ "end": 17,
89
+ "text": "\u20ac123.45",
90
+ "p": 1.0
91
+ },
92
+ {
93
+ "type": "choice",
94
+ "probs": [
95
+ 0.9511587619781494,
96
+ 0.027312880381941795,
97
+ 0.021528292447328568
98
+ ],
99
+ "choice": 0
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ "case": "options",
105
+ "tokens": 230,
106
+ "reference_precision": "bfloat16",
107
+ "upstream": [
108
+ {
109
+ "type": "choice",
110
+ "probs": [
111
+ 0.003604995086789131,
112
+ 0.003263695864006877,
113
+ 0.002579145599156618,
114
+ 0.0032084090635180473,
115
+ 0.0021689790301024914,
116
+ 0.002523764269426465,
117
+ 0.0024777702055871487,
118
+ 0.003174568759277463,
119
+ 0.0037178073544055223,
120
+ 0.0025443080812692642,
121
+ 0.003257984761148691,
122
+ 0.0031456719152629375,
123
+ 0.0022962531074881554,
124
+ 0.003111874219030142,
125
+ 0.0029890919104218483,
126
+ 0.003832802874967456,
127
+ 0.007152783218771219,
128
+ 0.922189474105835,
129
+ 0.005749549716711044,
130
+ 0.004194738809019327,
131
+ 0.0036519865971058607,
132
+ 0.003285554703325033,
133
+ 0.002670723246410489,
134
+ 0.003208014415577054
135
+ ],
136
+ "choice": 17
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ "case": "vision",
142
+ "tokens": 155,
143
+ "reference_precision": "bfloat16",
144
+ "upstream": [
145
+ {
146
+ "type": "region",
147
+ "cell": 21,
148
+ "box": [
149
+ 0.2459,
150
+ 0.0897,
151
+ 0.6864,
152
+ 0.9191
153
+ ],
154
+ "p": 0.6435877084732056
155
+ },
156
+ {
157
+ "type": "choice",
158
+ "probs": [
159
+ 0.9735397100448608,
160
+ 0.026460271328687668
161
+ ],
162
+ "choice": 0
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "case": "image-option",
168
+ "tokens": 181,
169
+ "reference_precision": "bfloat16",
170
+ "upstream": [
171
+ {
172
+ "type": "choice",
173
+ "probs": [
174
+ 0.9695415496826172,
175
+ 0.030458426102995872
176
+ ],
177
+ "choice": 0
178
+ }
179
+ ]
180
+ }
181
+ ]
bf16-comparison.json ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "case": "refund",
4
+ "max_probability_or_box_error": 0.0011562108993530273,
5
+ "discrete_outputs_match": true,
6
+ "upstream_bf16": [
7
+ {
8
+ "type": "noul",
9
+ "p_yes": 0.9697602987289429
10
+ },
11
+ {
12
+ "type": "choice",
13
+ "probs": [
14
+ 0.9355213642120361,
15
+ 0.02544301003217697,
16
+ 0.03903552144765854
17
+ ],
18
+ "choice": 0
19
+ }
20
+ ],
21
+ "coreai_float32": [
22
+ {
23
+ "type": "noul",
24
+ "p_yes": 0.9696579575538635
25
+ },
26
+ {
27
+ "type": "choice",
28
+ "probs": [
29
+ 0.9343651533126831,
30
+ 0.025729088112711906,
31
+ 0.03990578278899193
32
+ ],
33
+ "choice": 0
34
+ }
35
+ ]
36
+ },
37
+ {
38
+ "case": "span",
39
+ "max_probability_or_box_error": 0,
40
+ "discrete_outputs_match": true,
41
+ "upstream_bf16": [
42
+ {
43
+ "type": "span",
44
+ "start": 55,
45
+ "end": 63,
46
+ "text": "INV-2231",
47
+ "p": 1.0
48
+ }
49
+ ],
50
+ "coreai_float32": [
51
+ {
52
+ "type": "span",
53
+ "start": 55,
54
+ "end": 63,
55
+ "text": "INV-2231",
56
+ "p": 1.0
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "case": "score",
62
+ "max_probability_or_box_error": 0.0032760053873062134,
63
+ "discrete_outputs_match": true,
64
+ "upstream_bf16": [
65
+ {
66
+ "type": "score",
67
+ "probs": [
68
+ 0.01346411369740963,
69
+ 0.021021094173192978,
70
+ 0.13800419867038727,
71
+ 0.8275105953216553
72
+ ],
73
+ "choice": 3,
74
+ "expected": 2.7795612774789333
75
+ }
76
+ ],
77
+ "coreai_float32": [
78
+ {
79
+ "type": "score",
80
+ "probs": [
81
+ 0.013492124155163765,
82
+ 0.02104916237294674,
83
+ 0.13472819328308105,
84
+ 0.8307304382324219
85
+ ],
86
+ "choice": 3,
87
+ "expected": 2.7826968636363745
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "case": "multi",
93
+ "max_probability_or_box_error": 0.0007659792900085449,
94
+ "discrete_outputs_match": true,
95
+ "upstream_bf16": [
96
+ {
97
+ "type": "multi",
98
+ "probs": [
99
+ 0.961353600025177,
100
+ 0.9255949854850769,
101
+ 0.05097513645887375
102
+ ]
103
+ }
104
+ ],
105
+ "coreai_float32": [
106
+ {
107
+ "type": "multi",
108
+ "probs": [
109
+ 0.9614582657814026,
110
+ 0.9263609647750854,
111
+ 0.051194678992033005
112
+ ]
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ "case": "negative",
118
+ "max_probability_or_box_error": 0.0009359195828437805,
119
+ "discrete_outputs_match": true,
120
+ "upstream_bf16": [
121
+ {
122
+ "type": "noul",
123
+ "p_yes": 0.037488047033548355
124
+ }
125
+ ],
126
+ "coreai_float32": [
127
+ {
128
+ "type": "noul",
129
+ "p_yes": 0.036552127450704575
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ "case": "unicode",
135
+ "max_probability_or_box_error": 0.00025212764739990234,
136
+ "discrete_outputs_match": true,
137
+ "upstream_bf16": [
138
+ {
139
+ "type": "span",
140
+ "start": 10,
141
+ "end": 17,
142
+ "text": "\u20ac123.45",
143
+ "p": 1.0
144
+ },
145
+ {
146
+ "type": "choice",
147
+ "probs": [
148
+ 0.9511587619781494,
149
+ 0.027312880381941795,
150
+ 0.021528292447328568
151
+ ],
152
+ "choice": 0
153
+ }
154
+ ],
155
+ "coreai_float32": [
156
+ {
157
+ "type": "span",
158
+ "start": 10,
159
+ "end": 17,
160
+ "text": "\u20ac123.45",
161
+ "p": 1.0
162
+ },
163
+ {
164
+ "type": "choice",
165
+ "probs": [
166
+ 0.9514108896255493,
167
+ 0.027261406183242798,
168
+ 0.021327782422304153
169
+ ],
170
+ "choice": 0
171
+ }
172
+ ]
173
+ },
174
+ {
175
+ "case": "options",
176
+ "max_probability_or_box_error": 0.0006901025772094727,
177
+ "discrete_outputs_match": true,
178
+ "upstream_bf16": [
179
+ {
180
+ "type": "choice",
181
+ "probs": [
182
+ 0.003604995086789131,
183
+ 0.003263695864006877,
184
+ 0.002579145599156618,
185
+ 0.0032084090635180473,
186
+ 0.0021689790301024914,
187
+ 0.002523764269426465,
188
+ 0.0024777702055871487,
189
+ 0.003174568759277463,
190
+ 0.0037178073544055223,
191
+ 0.0025443080812692642,
192
+ 0.003257984761148691,
193
+ 0.0031456719152629375,
194
+ 0.0022962531074881554,
195
+ 0.003111874219030142,
196
+ 0.0029890919104218483,
197
+ 0.003832802874967456,
198
+ 0.007152783218771219,
199
+ 0.922189474105835,
200
+ 0.005749549716711044,
201
+ 0.004194738809019327,
202
+ 0.0036519865971058607,
203
+ 0.003285554703325033,
204
+ 0.002670723246410489,
205
+ 0.003208014415577054
206
+ ],
207
+ "choice": 17
208
+ }
209
+ ],
210
+ "coreai_float32": [
211
+ {
212
+ "type": "choice",
213
+ "probs": [
214
+ 0.0035737575963139534,
215
+ 0.0032294215634465218,
216
+ 0.0025455907452851534,
217
+ 0.0031847632490098476,
218
+ 0.002165550133213401,
219
+ 0.002492170315235853,
220
+ 0.0024529574438929558,
221
+ 0.003147532232105732,
222
+ 0.0037047737278044224,
223
+ 0.0024940771982073784,
224
+ 0.0032223134767264128,
225
+ 0.003116679610684514,
226
+ 0.002279103733599186,
227
+ 0.003067179350182414,
228
+ 0.0030036454554647207,
229
+ 0.0037965381052345037,
230
+ 0.007012164685875177,
231
+ 0.9228795766830444,
232
+ 0.0057253348641097546,
233
+ 0.004146119579672813,
234
+ 0.00362235214561224,
235
+ 0.0032782102935016155,
236
+ 0.002652023686096072,
237
+ 0.0032081108074635267
238
+ ],
239
+ "choice": 17
240
+ }
241
+ ]
242
+ },
243
+ {
244
+ "case": "vision",
245
+ "max_probability_or_box_error": 0.10930000000000001,
246
+ "discrete_outputs_match": false,
247
+ "upstream_bf16": [
248
+ {
249
+ "type": "region",
250
+ "cell": 21,
251
+ "box": [
252
+ 0.2459,
253
+ 0.0897,
254
+ 0.6864,
255
+ 0.9191
256
+ ],
257
+ "p": 0.6435877084732056
258
+ },
259
+ {
260
+ "type": "choice",
261
+ "probs": [
262
+ 0.9735397100448608,
263
+ 0.026460271328687668
264
+ ],
265
+ "choice": 0
266
+ }
267
+ ],
268
+ "coreai_float32": [
269
+ {
270
+ "type": "region",
271
+ "cell": 33,
272
+ "box": [
273
+ 0.3552,
274
+ 0.0785,
275
+ 0.747,
276
+ 0.9124
277
+ ],
278
+ "p": 0.6444705128669739
279
+ },
280
+ {
281
+ "type": "choice",
282
+ "probs": [
283
+ 0.974250316619873,
284
+ 0.025749672204256058
285
+ ],
286
+ "choice": 0
287
+ }
288
+ ]
289
+ },
290
+ {
291
+ "case": "image-option",
292
+ "max_probability_or_box_error": 0.000291287899017334,
293
+ "discrete_outputs_match": true,
294
+ "upstream_bf16": [
295
+ {
296
+ "type": "choice",
297
+ "probs": [
298
+ 0.9695415496826172,
299
+ 0.030458426102995872
300
+ ],
301
+ "choice": 0
302
+ }
303
+ ],
304
+ "coreai_float32": [
305
+ {
306
+ "type": "choice",
307
+ "probs": [
308
+ 0.9698328375816345,
309
+ 0.03016720339655876
310
+ ],
311
+ "choice": 0
312
+ }
313
+ ]
314
+ }
315
+ ]
calibration.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "span": {
3
+ "cap": 128,
4
+ "penalty": 1.6,
5
+ "fitted_on": "held-out quotes: the quote-amounts slice and longquotes clean.jsonl (fit halves), 2026-10-08; cap raised, penalty kept so short quotes are unchanged"
6
+ }
7
+ }
config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"base": "Qwen/Qwen3.5-9B"}
convert_decoder.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Export AMOS Qwen3.5 bidirectional decisions and trained quote/box heads."""
2
+ import argparse,json,math,sys
3
+ from pathlib import Path
4
+ import torch
5
+ from coreai_torch import TorchConverter,get_decomp_table
6
+ from qwen_export_helpers import DecisionVision
7
+
8
+ class Text(torch.nn.Module):
9
+ def __init__(self,model,letters):
10
+ super().__init__();self.language_model=model.model.language_model;self.noncausal=bool(getattr(model.config,'amos_noncausal',False))
11
+ self.register_buffer('readout',model.get_output_embeddings().weight[letters].detach().float().clone())
12
+ def forward(self,input_ids,attention_mask,position_ids,visual_embeddings,visual_mask):
13
+ emb=self.language_model.embed_tokens(input_ids)
14
+ emb=torch.where(visual_mask,visual_embeddings.to(emb.dtype),emb)
15
+ mask=attention_mask[:,None,None,:].bool()
16
+ if not self.noncausal:
17
+ width=input_ids.shape[1];idx=torch.arange(width,device=input_ids.device);mask=mask&(idx[:,None]>=idx[None,:])[None,None]
18
+ h=self.language_model(inputs_embeds=emb,attention_mask={'full_attention':mask,'linear_attention':None},position_ids=position_ids,use_cache=False).last_hidden_state
19
+ return h.float(),h.float()@self.readout.T
20
+
21
+ class Heads(torch.nn.Module):
22
+ def __init__(self,heads):super().__init__();self.heads=heads
23
+ def forward(self,question_hidden,state_hidden,image_hidden):
24
+ h=self.heads;d=question_hidden.shape[0];dtype=h.span_q.weight.dtype
25
+ q=question_hidden.to(dtype);s=state_hidden.to(dtype);im=image_hidden.to(dtype)
26
+ span=torch.einsum('cd,lcd->cl',h.span_q(q).view(2,d),h.span_k(s).view(-1,2,d))/math.sqrt(d)
27
+ region=h.region_k(im)@h.region_q(q)/math.sqrt(d)
28
+ box=h.box(q,im,region,7,7) if h.box is not None else torch.zeros(4)
29
+ return span.float(),region.float(),box.float()
30
+
31
+ def save(m,args,path):
32
+ with torch.no_grad():ep=torch.export.export(m,args,strict=False).run_decompositions(get_decomp_table())
33
+ program=TorchConverter().add_exported_program(ep).to_coreai();program.save_asset(path)
34
+ return list(ep.graph_signature.user_outputs)
35
+
36
+ def main():
37
+ p=argparse.ArgumentParser();p.add_argument('name');p.add_argument('--length',type=int,default=512);p.add_argument('--precision',default='bfloat16');a=p.parse_args()
38
+ source=Path('upstream')/a.name;out=Path('bundles')/(a.name+'-CoreAI');out.mkdir(parents=True,exist_ok=True)
39
+ sys.path.insert(0,str((source/'serve').resolve()))
40
+ from amos.decoder import load_model,load_heads
41
+ torch.set_num_threads(4);model,codec=load_model(str(source/'model'),'cpu',dtype=getattr(torch,a.precision));model.eval();heads=load_heads(source/'model',model,codec)
42
+ d=model.config.text_config.hidden_size;L=a.length
43
+ inputs=(torch.full((1,L),codec.pad,dtype=torch.int32),torch.ones(1,L,dtype=torch.int32),torch.arange(L,dtype=torch.int32).view(1,1,-1).expand(4,1,-1),torch.zeros(1,L,d),torch.zeros(1,L,1,dtype=torch.bool))
44
+ print('Exporting text',flush=True);outputs=save(Text(model,codec.letters).eval(),inputs,out/'text.aimodel')
45
+ print('Exporting vision',flush=True);visual=model.model.visual;vo=save(DecisionVision(visual).eval(),(torch.zeros(196,1536),),out/'vision.aimodel')
46
+ print('Exporting heads',flush=True);ho=save(Heads(heads).eval(),(torch.zeros(d),torch.zeros(L,d),torch.zeros(49,d)),out/'heads.aimodel')
47
+ (out/'manifest.json').write_text(json.dumps({'sequence_length':L,'hidden_size':d,'outputs':outputs,'vision_output':vo[0],'head_outputs':ho,'precision':a.precision,'echo':codec.echo,'kinds':heads.kinds,'keep':heads.keep,'has_box':heads.box is not None,'image_side':224,'noncausal':bool(getattr(model.config,'amos_noncausal',False))},indent=2))
48
+ print('Saved',flush=True)
49
+ if __name__=='__main__':main()
convert_medium_sharded.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Export FP32 AMOS medium one component at a time to bound conversion memory."""
2
+ import gc,json,sys
3
+ from pathlib import Path
4
+ import torch
5
+ from convert_decoder import save,Heads
6
+ from qwen_export_helpers import DecisionVision
7
+
8
+ class Embedding(torch.nn.Module):
9
+ def __init__(self,decoder):super().__init__();self.embed_tokens=decoder.embed_tokens;self.rotary=decoder.rotary_emb
10
+ def forward(self,input_ids,position_ids,visual_embeddings,visual_mask):
11
+ h=torch.where(visual_mask,visual_embeddings,self.embed_tokens(input_ids))
12
+ cos,sin=self.rotary(h,position_ids[1:]);return h,cos,sin
13
+
14
+ class Layer(torch.nn.Module):
15
+ def __init__(self,layer):super().__init__();self.layer=layer
16
+ def forward(self,hidden_states,cos,sin,position_ids,attention_mask):
17
+ return self.layer(hidden_states,position_embeddings=(cos,sin),position_ids=position_ids,attention_mask=attention_mask if self.layer.block_type=='full_attention' else None,use_cache=False)
18
+
19
+ class Finish(torch.nn.Module):
20
+ def __init__(self,model,letters):
21
+ super().__init__();self.norm=model.model.language_model.norm
22
+ self.register_buffer('readout',model.get_output_embeddings().weight[letters].detach().float().clone())
23
+ def forward(self,hidden_states):
24
+ h=self.norm(hidden_states);return h,h@self.readout.T
25
+
26
+ def main():
27
+ source=Path('upstream/amos-1-medium');root=Path('bundles/amos-1-medium-CoreAI');root.mkdir(exist_ok=True,parents=True)
28
+ sys.path.insert(0,str((source/'serve').resolve()))
29
+ from amos.decoder import load_model,load_heads
30
+ torch.set_num_threads(4)
31
+ m,codec=load_model(str(source/'model'),'cpu',dtype=torch.bfloat16);m.eval();heads=load_heads(source/'model',m,codec)
32
+ from stable_delta import install
33
+ install()
34
+ decoder=m.model.language_model;L=512;d=decoder.config.hidden_size
35
+ manifest={'sequence_length':L,'hidden_size':d,'precision':'float32','vision_precision':'float32','echo':codec.echo,'kinds':heads.kinds,'keep':heads.keep,'has_box':heads.box is not None,'image_side':224,'noncausal':False,'text_layout':'layer-sharded','layers':[]}
36
+ path=root/'embedding.aimodel'
37
+ decoder.embed_tokens.float();emb=Embedding(decoder).eval()
38
+ args=(torch.ones(1,L,dtype=torch.int32),torch.arange(L,dtype=torch.int32).view(1,1,-1).expand(4,1,-1),torch.zeros(1,L,d),torch.zeros(1,L,1,dtype=torch.bool))
39
+ with torch.no_grad():_,cos,sin=emb(*args)
40
+ print('Embedding',flush=True);manifest['embedding_outputs']=save(emb,args,path)
41
+ decoder.embed_tokens.to('meta');del emb;gc.collect()
42
+ layer_args=(torch.zeros(1,L,d),cos,sin,torch.arange(L,dtype=torch.int32)[None],torch.ones(1,1,L,L,dtype=torch.bool).tril())
43
+ for i,layer in enumerate(decoder.layers):
44
+ name=f'layer-{i:02}.aimodel';print(name,flush=True)
45
+ layer.float().eval();outputs=save(Layer(layer).eval(),layer_args,root/name)
46
+ manifest['layers'].append({'asset':name,'output':outputs[0],'kind':layer.block_type})
47
+ layer.to('meta');gc.collect()
48
+ print('Finish',flush=True);decoder.norm.float();manifest['outputs']=save(Finish(m,codec.letters).eval(),(torch.zeros(1,L,d),),root/'finish.aimodel')
49
+ m.get_output_embeddings().to('meta');decoder.norm.to('meta');gc.collect()
50
+ print('Vision',flush=True);m.model.visual.float();manifest['vision_output']=save(DecisionVision(m.model.visual).eval(),(torch.zeros(196,1536),),root/'vision.aimodel')[0]
51
+ m.model.visual.to('meta');gc.collect()
52
+ print('Heads',flush=True);manifest['head_outputs']=save(Heads(heads).eval(),(torch.zeros(d),torch.zeros(L,d),torch.zeros(49,d)),root/'heads.aimodel')
53
+ (root/'manifest.json').write_text(json.dumps(manifest,indent=2));print('Saved FP32 sharded model',flush=True)
54
+ if __name__=='__main__':main()
coreai_decoder.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """AMOS Qwen3.5 Core AI adapter. No PyTorch neural model is loaded."""
2
+ import json,sys
3
+ from pathlib import Path
4
+ import numpy as np
5
+ import torch
6
+ from coreai.runtime import AIModel,NDArray,SpecializationOptions
7
+ from transformers import AutoTokenizer,Qwen2VLImageProcessorPil
8
+
9
+ class AmosDecoder:
10
+ @classmethod
11
+ async def load(cls,bundle):
12
+ self=cls();self.root=Path(bundle).resolve();sys.path.insert(0,str(self.root/'serve'))
13
+ import amos.decoder as decoder
14
+ decoder.IMAGE_PIXELS=224*224
15
+ self.manifest=json.loads((self.root/'manifest.json').read_text())
16
+ self.codec=decoder.Codec(AutoTokenizer.from_pretrained(self.root/'model'),Qwen2VLImageProcessorPil.from_pretrained(self.root/'model',size={'shortest_edge':224*224,'longest_edge':224*224}),255)
17
+ self.codec.echo=self.manifest['echo']
18
+ self.temperature=decoder.calibration(self.root) or {};self.span=decoder.span_decoding(self.root)
19
+ self.models=[];self.functions={}
20
+ names=['vision','heads']
21
+ if self.manifest.get('text_layout')=='layer-sharded':names+=['embedding','finish']+[r['asset'].removesuffix('.aimodel') for r in self.manifest['layers']]
22
+ else:names+=['text']
23
+ for name in names:
24
+ m=await AIModel.load(self.root/(name+'.aimodel'),SpecializationOptions.default());self.models.append(m);self.functions[name]=m.load_function('main')
25
+ return self
26
+
27
+ async def raw(self,state,questions,images=()):
28
+ from amos.decoder import expand
29
+ from PIL import Image
30
+ def resize(im):return im.convert('RGB').resize((224,224),Image.Resampling.BICUBIC)
31
+ images=[resize(im) for im in images]
32
+ questions=[{**q,'options':[resize(o) if isinstance(o,Image.Image) else o for o in q['options']]} if 'options' in q else q for q in questions]
33
+ flat,owner=expand(questions)
34
+ ids,at,extra=self.codec.encode_case(state,flat,images)
35
+ n=len(ids);L=self.manifest['sequence_length'];d=self.manifest['hidden_size']
36
+ if n>L:raise ValueError(f'Request needs {n} tokens; Core AI capacity is {L}.')
37
+ args={'input_ids':np.full((1,L),self.codec.pad,np.int32),'attention_mask':np.zeros((1,L),np.int32),'position_ids':np.zeros((4,1,L),np.int32),'visual_embeddings':np.zeros((1,L,d),np.float32),'visual_mask':np.zeros((1,L,1),bool)}
38
+ args['input_ids'][0,:n]=ids;args['attention_mask'][0,:n]=1;args['position_ids'][0,0,:n]=np.arange(n)
39
+ image_at={s:(rows,cols) for s,rows,cols in extra.get('images',[])}
40
+ features=[]
41
+ if image_at:
42
+ pv=extra['pixel_values'].numpy()
43
+ for start in range(0,len(pv),196):
44
+ out=await self.functions['vision']({'pixel_values':NDArray(pv[start:start+196].astype(np.float32))});features.append(out[self.manifest['vision_output']].numpy())
45
+ cursor=0;offset=0;fi=0
46
+ while cursor<n:
47
+ if cursor in image_at:
48
+ rows,cols=image_at[cursor]
49
+ if (rows,cols)!=(7,7):raise ValueError('Only 224x224 image grids are supported')
50
+ end=cursor+49;args['position_ids'][1,0,cursor:end]=offset;args['position_ids'][2,0,cursor:end]=offset+np.repeat(np.arange(7),7);args['position_ids'][3,0,cursor:end]=offset+np.tile(np.arange(7),7)
51
+ args['visual_embeddings'][0,cursor:end]=features[fi];args['visual_mask'][0,cursor:end]=True;offset+=7;cursor=end;fi+=1
52
+ else:
53
+ args['position_ids'][1:,0,cursor]=offset;offset+=1;cursor+=1
54
+ if self.manifest.get('text_layout')=='layer-sharded':
55
+ result=await self.functions['embedding']({k:NDArray(v) for k,v in args.items() if k!='attention_mask'})
56
+ h,cos,sin=[result[k] for k in self.manifest['embedding_outputs']]
57
+ causal=(np.arange(L)[:,None]>=np.arange(L)[None,:])[None,None]&args['attention_mask'][:,None,None,:].astype(bool)
58
+ for layer in self.manifest['layers']:
59
+ result=await self.functions[layer['asset'].removesuffix('.aimodel')]({'hidden_states':h,'cos':cos,'sin':sin,'position_ids':NDArray(args['position_ids'][0].copy()),'attention_mask':NDArray(causal)})
60
+ h=result[layer['output']]
61
+ output=await self.functions['finish']({'hidden_states':h})
62
+ else:output=await self.functions['text']({k:NDArray(v) for k,v in args.items()})
63
+ hidden,logits=[output[k].numpy() for k in self.manifest['outputs']]
64
+ head_results={}
65
+ for i,(q,pos) in enumerate(zip(flat,at)):
66
+ if q['type'] not in ['span','region']:continue
67
+ first,offsets=extra['state'];state_hidden=np.zeros((L,d),np.float32);state_hidden[:len(offsets)]=hidden[0,first:first+len(offsets)]
68
+ cells=np.zeros((49,d),np.float32)
69
+ if extra.get('images'):
70
+ start,rows,cols=extra['images'][0];cells=hidden[0,start:start+49].copy()
71
+ if q['type']=='region' and not extra.get('images'):raise ValueError('Region requires a state image')
72
+ ho=await self.functions['heads']({'question_hidden':NDArray(hidden[0,pos].copy()),'state_hidden':NDArray(state_hidden),'image_hidden':NDArray(cells)})
73
+ span,region,box=[torch.from_numpy(ho[k].numpy().copy()) for k in self.manifest['head_outputs']]
74
+ head_results[i]=span[:,:len(offsets)] if q['type']=='span' else torch.cat([region,box]) if self.manifest['has_box'] else region
75
+ return {'flat':flat,'owner':owner,'at':at,'extra':extra,'logits':logits[0],'heads':head_results,'tokens':n,'hidden':hidden[0]}
76
+
77
+ async def predict(self,state,questions,images=()):
78
+ from amos.decoder import options,decode_head
79
+ raw=await self.raw(state,questions,images);out=[None]*len(questions)
80
+ for j,(q,k,pos) in enumerate(zip(raw['flat'],raw['owner'],raw['at'])):
81
+ typ=questions[k]['type']
82
+ if q['type'] in ['span','region']:
83
+ out[k]=decode_head(q,raw['heads'][j],raw['extra'],state,self.manifest['keep'],self.span);continue
84
+ logits=torch.tensor(raw['logits'][pos,:len(options(q))]);p=(logits/self.temperature.get(q['type'],1)).softmax(-1).tolist()
85
+ if typ=='multi':out[k]=out[k] or {'type':typ,'probs':[]};out[k]['probs'].append(p[0])
86
+ elif typ=='noul':out[k]={'type':typ,'p_yes':p[0]}
87
+ else:
88
+ out[k]={'type':typ,'probs':p,'choice':int(np.argmax(p))}
89
+ if typ=='score':out[k]['expected']=sum(i*v for i,v in enumerate(p))
90
+ return out
91
+
92
+ async def request(self,req):
93
+ from amos.serve import parse,answer
94
+ from PIL import Image
95
+ import base64,io
96
+ def image(s):return Image.open(io.BytesIO(base64.b64decode(s.split(',')[-1]))).convert('RGB')
97
+ state,ids,qs=parse(req);ims=[image(s) for s in req.get('images',[])]
98
+ qs=[{**q,'options':[image(o['image']) if isinstance(o,dict) else o for o in q['options']]} if 'options' in q else q for q in qs]
99
+ rs=await self.predict(state,qs,ims)
100
+ return {'answers':{i:answer(q,r) for i,q,r in zip(ids,qs,rs)}}
embedding.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ o��,�v�j�\�}�ixRw/��ר�J���t
embedding.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fcec91d2cdc76e76a855ccc7dc61d10697852772f81b6d7a8d94af4ac897407
3
+ size 4068486672
embedding.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261014T014939Z",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "assetVersion" : "2.0"
5
+ }
finish.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ @��G�l�W��vy���H rb�bia��|
finish.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40ed1efe47f26cc15794ce7616798dd2f948207262fd62041b6961e381f37c15
3
+ size 4199075
finish.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "creationDate" : "20261014T015037Z"
5
+ }
heads.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ ESa���Wf��SD��hr��܁�Aň��T'
heads.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:455361e9ff9557669def5344f8db6872e1bdcddc81e41141c5888cce54197f27
3
+ size 419568833
heads.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "producer" : "coreai-core 1.0.0b3",
3
+ "assetVersion" : "2.0",
4
+ "creationDate" : "20261014T015042Z"
5
+ }
layer-00.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ ���+��]ǖf.�<��a.��w["n��5��@
layer-00.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b506c0c52bdffe5dc796662ea73c92c2612ee4dc775b226ec60110b93594c740
3
+ size 873853573
layer-00.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "creationDate" : "20261014T014943Z"
5
+ }
layer-01.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ 6V�e��7�c}�4!Ђ���U�S��$��2�
layer-01.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3656fc65add337eb97637dd47f3421d082f8d11ba555f753dddd24068ce732c1
3
+ size 873853572
layer-01.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261014T014945Z",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "assetVersion" : "2.0"
5
+ }
layer-02.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ BaQT"�|_c:J�6��$�hi@#������~�
layer-02.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4261515422e07c5f633a4a8436fdd724d768694023941be5f8fed0a6c7ce7ef2
3
+ size 873853568
layer-02.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "creationDate" : "20261014T014947Z"
5
+ }
layer-03.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ @���'�Tf@ZI!Ө������Zݝh��"�5
layer-03.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40b6b0de27b454661002405a4921d3a8a88e0efabdadc45add9d68abe322a135
3
+ size 838922538
layer-03.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261014T014948Z",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "assetVersion" : "2.0"
5
+ }
layer-04.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ ���������Ygl�jz2��*I#z���V
layer-04.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbf1ad7ff01a89c1aebf1693e059676cff6a7a3219feee2a49237a1aba83b856
3
+ size 873853569
layer-04.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "creationDate" : "20261014T014950Z"
5
+ }
layer-05.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ �8@�(~}�KЪ�M�o졉��/�ZVY�m4�
layer-05.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8ba384095287e7d9f4bd0aa05b34dad6feca189a7f32fae5a5659b86d1b34e2
3
+ size 873853571
layer-05.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261014T014952Z",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "assetVersion" : "2.0"
5
+ }
layer-06.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ �W��z�y��<���Q��mN�K���Mn�Y�
layer-06.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a15792d07af6107986f80e3cf495be519d976d4ee64bb110fabb4d6e1ba959d8
3
+ size 873853571
layer-06.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "creationDate" : "20261014T014954Z"
5
+ }
layer-07.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ ѭt4����������Z?�M7+,�����׍e
layer-07.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1ad7434add3c0c3d4effdd2f98f5a3fef4d14372b2c1fe21e8bbd93b1d78d65
3
+ size 838922541
layer-07.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "creationDate" : "20261014T014955Z"
5
+ }
layer-08.aimodel/main.hash ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ǿ�i��xR4��a��MOw��0���IP
2
+ ��
layer-08.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7bffc69c084785234be0faa61a38d4d4f77c1aa1630bb9be44950160ad8f70e
3
+ size 873853569
layer-08.aimodel/metadata.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261014T014957Z",
3
+ "producer" : "coreai-core 1.0.0b3",
4
+ "assetVersion" : "2.0"
5
+ }
layer-09.aimodel/main.hash ADDED
Binary file (32 Bytes). View file
 
layer-09.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f7401a15775cd13ac01a5000bbfb55e2aaba194d2e7315540d09b9c66fcbaea
3
+ size 873853567