Release validated Core ML bundle and model card
Browse files- .gitattributes +1 -0
- LICENSE +176 -0
- NOTICE +22 -0
- README.md +90 -0
- coreml_config.json +60 -0
- encoder/config.json +79 -0
- model.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
- model.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
- model.mlpackage/Manifest.json +18 -0
- rl_agent_config.json +26 -0
- tokenizer/tokenizer.json +3 -0
- tokenizer/tokenizer_config.json +22 -0
- validation.json +130 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ 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 |
+
tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
NOTICE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
laya-coreml
|
| 2 |
+
Copyright 2026 laya-coreml contributors
|
| 3 |
+
|
| 4 |
+
This product includes software adapted from Laya (Apache-2.0):
|
| 5 |
+
https://github.com/NandhaKishorM/laya
|
| 6 |
+
Copyright Convai Innovations and Laya contributors.
|
| 7 |
+
Upstream source revision: 6a5819129eb220570792e417e49723d697efd76f
|
| 8 |
+
|
| 9 |
+
Prompt construction, tokenization, result formatting, validation fixtures,
|
| 10 |
+
the ModernBERT architecture implementation, and the Snake game, policy, terminal
|
| 11 |
+
UI, recording/export and benchmark tools are adapted from laya-mlx:
|
| 12 |
+
https://github.com/mizorewww/laya-mlx
|
| 13 |
+
Copyright 2026 laya-mlx contributors. Licensed under Apache-2.0.
|
| 14 |
+
Adapted revision: fc1df62828a3fedf4d8229fdac1cbd85f1cdf337
|
| 15 |
+
Changes: Core ML runtime, export-only PyTorch graph, fixed/ranged shape input
|
| 16 |
+
handling, Core ML validation, device planning, and performance measurement;
|
| 17 |
+
ANE graph/runtime, portable model bundles and offline Core ML Snake integration.
|
| 18 |
+
|
| 19 |
+
The model follows Laya's DecisionModel and Hugging Face Transformers ModernBERT.
|
| 20 |
+
Original checkpoint weights belong to their respective upstream authors and
|
| 21 |
+
are downloaded separately. No weights are included in this repository.
|
| 22 |
+
This is an independent project, not an official Convai Innovations or Apple release.
|
README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: coreml
|
| 4 |
+
pipeline_tag: text-classification
|
| 5 |
+
base_model: convaiinnovations/laya-multilingual
|
| 6 |
+
tags:
|
| 7 |
+
- coreml
|
| 8 |
+
- laya
|
| 9 |
+
- apple-silicon
|
| 10 |
+
- decision-model
|
| 11 |
+
- local-ai
|
| 12 |
+
- modernbert
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# laya-multilingual-coreml-snake
|
| 16 |
+
|
| 17 |
+
**Laya typed decisions on Apple Silicon, using CPU + GPU.**
|
| 18 |
+
This is a portable Core ML bundle for [laya-coreml](https://github.com/mizorewww/laya-coreml),
|
| 19 |
+
converted from [convaiinnovations/laya-multilingual](https://huggingface.co/convaiinnovations/laya-multilingual).
|
| 20 |
+
It outputs `choice`, `score`, and `noul` probabilities with **zero generated tokens**.
|
| 21 |
+
Inference needs no PyTorch, Transformers, MLX, remote code, or cloud API.
|
| 22 |
+
|
| 23 |
+
## Run
|
| 24 |
+
|
| 25 |
+
Apple Silicon, macOS 15+, Python 3.11–3.13. Tested on M3 Max / macOS 27.2.
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
pip install laya-coreml
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
import laya_coreml as laya
|
| 33 |
+
|
| 34 |
+
agent = laya.load("aac6fef/laya-multilingual-coreml-snake") # Download once; Core ML runs locally.
|
| 35 |
+
result = agent.predict(
|
| 36 |
+
"The customer asks for a refund of a duplicate payment.",
|
| 37 |
+
{"refund": {"type": "noul", "instructions": "Does the customer request a refund?"}},
|
| 38 |
+
)
|
| 39 |
+
print(result["answers"])
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
To download explicitly and then run entirely offline:
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
hf download aac6fef/laya-multilingual-coreml-snake --local-dir models/snake
|
| 46 |
+
pip install 'laya-coreml[demo]'
|
| 47 |
+
laya-coreml-snake --model models/snake --fps 12
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
Use `laya.load("aac6fef/laya-multilingual-coreml-snake", local_files_only=True)` for a cached snapshot or pass a
|
| 51 |
+
local directory. Use `revision="<Hub commit SHA>"` to pin a remote revision.
|
| 52 |
+
|
| 53 |
+
## Format and fidelity
|
| 54 |
+
|
| 55 |
+
This FP16 export retains the original model architecture and decision schema. The enumerated-length GPU export is the validated general-purpose configuration.
|
| 56 |
+
|
| 57 |
+
The matching fixed B3/L64 Snake export agreed with MLX on 600/600 actions across two 300-step trajectories, with zero deaths and zero safety interventions. It is a specialized 64-token export, not the full-context general-purpose model.
|
| 58 |
+
|
| 59 |
+
The exported capacity is **64 total tokens**, batch **3**,
|
| 60 |
+
and **4** option slots. Questions/options and state share this budget.
|
| 61 |
+
The ANE short exports reject over-capacity prompts. Snake uses planner features and a
|
| 62 |
+
visible optional cycle safety shield; survival is not a claim of unaided game intelligence.
|
| 63 |
+
|
| 64 |
+
`coreml_config.json` records shapes, source revisions and per-file SHA256 checksums.
|
| 65 |
+
`validation.json` contains the packaging-time validation. Port fidelity on this regression
|
| 66 |
+
suite does not establish general task accuracy or preserved calibration on arbitrary inputs.
|
| 67 |
+
|
| 68 |
+
## Performance and limits
|
| 69 |
+
|
| 70 |
+
The multilingual **ANE L96 FP16** runtime measured **4.98 / 5.31 ms P50 / P95** for
|
| 71 |
+
one short question on M3 Max; W8 measured **4.88 / 5.23 ms**. Whole-system energy per
|
| 72 |
+
decision improved **2.78× / 3.19×**, respectively, against compiled MLX FP16 in that
|
| 73 |
+
experiment. Those numbers apply to the named short ANE variants, not every bundle,
|
| 74 |
+
long contexts, or complete Snake frames. The requested 10× improvement was not achieved.
|
| 75 |
+
|
| 76 |
+
[Measurements and scope](https://github.com/mizorewww/laya-coreml/blob/main/docs/ANE_BENCHMARKS.md)
|
| 77 |
+
· [General Core ML benchmarks](https://github.com/mizorewww/laya-coreml/blob/main/BENCHMARKS.md)
|
| 78 |
+
· [Snake demo](https://github.com/mizorewww/laya-coreml/blob/main/docs/SNAKE_DEMO.md).
|
| 79 |
+
|
| 80 |
+
## Provenance
|
| 81 |
+
|
| 82 |
+
- Original checkpoint: `convaiinnovations/laya-multilingual` at `052592a15d198d9ad47da779604259b10b47b7aa`.
|
| 83 |
+
- Original weights SHA256: `9d628fd971b700382ac6f65920a86f149777b2e748e0c955fb3b19695aa8f204`.
|
| 84 |
+
- Upstream implementation: [NandhaKishorM/laya](https://github.com/NandhaKishorM/laya),
|
| 85 |
+
commit `6a5819129eb220570792e417e49723d697efd76f`.
|
| 86 |
+
- Original models and code are by Convai Innovations and contributors, Apache-2.0.
|
| 87 |
+
- Independent conversion; not an official Convai Innovations or Apple release.
|
| 88 |
+
|
| 89 |
+
See `LICENSE` and `NOTICE`. Model quality and task/language limitations originate
|
| 90 |
+
with Laya; this runtime is an inference port, not a newly trained decision model.
|
coreml_config.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format": "laya-coreml",
|
| 3 |
+
"format_version": 1,
|
| 4 |
+
"source": "convaiinnovations/laya-multilingual",
|
| 5 |
+
"revision": "052592a15d198d9ad47da779604259b10b47b7aa",
|
| 6 |
+
"source_weights_sha256": "9d628fd971b700382ac6f65920a86f149777b2e748e0c955fb3b19695aa8f204",
|
| 7 |
+
"precision": "float16",
|
| 8 |
+
"attention": "sdpa",
|
| 9 |
+
"attention_mask_construction": "integer_positions_v2",
|
| 10 |
+
"minimum_deployment_target": "macOS15 / iOS18",
|
| 11 |
+
"shape": {
|
| 12 |
+
"batch_size": 3,
|
| 13 |
+
"max_length": 64,
|
| 14 |
+
"min_length": 16,
|
| 15 |
+
"default_length": 64,
|
| 16 |
+
"max_options": 4,
|
| 17 |
+
"flexible": false,
|
| 18 |
+
"mode": "fixed",
|
| 19 |
+
"lengths": null
|
| 20 |
+
},
|
| 21 |
+
"versions": {
|
| 22 |
+
"coremltools": "9.0",
|
| 23 |
+
"torch": "2.7.0",
|
| 24 |
+
"numpy": "2.1.3"
|
| 25 |
+
},
|
| 26 |
+
"conversion_seconds": 11.188042791000044,
|
| 27 |
+
"files": {
|
| 28 |
+
"encoder/config.json": {
|
| 29 |
+
"bytes": 1938,
|
| 30 |
+
"sha256": "83f6916d13ef0f556ac461f28308dc2bffa7ebeadee8ec9e2db5812020ea5bb4"
|
| 31 |
+
},
|
| 32 |
+
"model.mlpackage/Data/com.apple.CoreML/model.mlmodel": {
|
| 33 |
+
"bytes": 304523,
|
| 34 |
+
"sha256": "d179f5ebd939d34814e220af2dad78de8ad03e4b07a18831e0bc36451ef6188c"
|
| 35 |
+
},
|
| 36 |
+
"model.mlpackage/Data/com.apple.CoreML/weights/weight.bin": {
|
| 37 |
+
"bytes": 643843328,
|
| 38 |
+
"sha256": "de5ceb1a6c358e1dd26d218fda93a0297181a19e518bdae73608485fe0b91872"
|
| 39 |
+
},
|
| 40 |
+
"model.mlpackage/Manifest.json": {
|
| 41 |
+
"bytes": 617,
|
| 42 |
+
"sha256": "e5fb516b71968447bede5207f22dc3d6662792823cb56c8d1dc17038ba2d27b9"
|
| 43 |
+
},
|
| 44 |
+
"rl_agent_config.json": {
|
| 45 |
+
"bytes": 472,
|
| 46 |
+
"sha256": "25061739243b617ad88d1219ba6f8a9c86c5881ca28df024fa2d9b3b2fcc30c6"
|
| 47 |
+
},
|
| 48 |
+
"tokenizer/tokenizer.json": {
|
| 49 |
+
"bytes": 34363188,
|
| 50 |
+
"sha256": "609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f"
|
| 51 |
+
},
|
| 52 |
+
"tokenizer/tokenizer_config.json": {
|
| 53 |
+
"bytes": 524,
|
| 54 |
+
"sha256": "6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1"
|
| 55 |
+
}
|
| 56 |
+
},
|
| 57 |
+
"source_revision": "052592a15d198d9ad47da779604259b10b47b7aa",
|
| 58 |
+
"repository": "aac6fef/laya-multilingual-coreml-snake",
|
| 59 |
+
"package_sha256": "85a738c18147a7485ea738b6238f43ab7d1740b58d8af37b83d8878f64ab563b"
|
| 60 |
+
}
|
encoder/config.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"ModernBertForMaskedLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 2,
|
| 8 |
+
"classifier_activation": "gelu",
|
| 9 |
+
"classifier_bias": false,
|
| 10 |
+
"classifier_dropout": 0.0,
|
| 11 |
+
"classifier_pooling": "mean",
|
| 12 |
+
"cls_token_id": 1,
|
| 13 |
+
"decoder_bias": true,
|
| 14 |
+
"deterministic_flash_attn": false,
|
| 15 |
+
"dtype": "float32",
|
| 16 |
+
"embedding_dropout": 0.0,
|
| 17 |
+
"eos_token_id": 1,
|
| 18 |
+
"global_attn_every_n_layers": 3,
|
| 19 |
+
"gradient_checkpointing": false,
|
| 20 |
+
"hidden_activation": "gelu",
|
| 21 |
+
"hidden_size": 768,
|
| 22 |
+
"initializer_cutoff_factor": 2.0,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 1152,
|
| 25 |
+
"layer_norm_eps": 1e-05,
|
| 26 |
+
"layer_types": [
|
| 27 |
+
"full_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"sliding_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"sliding_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"full_attention"
|
| 49 |
+
],
|
| 50 |
+
"local_attention": 128,
|
| 51 |
+
"mask_token_id": 4,
|
| 52 |
+
"max_position_embeddings": 8192,
|
| 53 |
+
"mlp_bias": false,
|
| 54 |
+
"mlp_dropout": 0.0,
|
| 55 |
+
"model_type": "modernbert",
|
| 56 |
+
"norm_bias": false,
|
| 57 |
+
"norm_eps": 1e-05,
|
| 58 |
+
"num_attention_heads": 12,
|
| 59 |
+
"num_hidden_layers": 22,
|
| 60 |
+
"pad_token_id": 0,
|
| 61 |
+
"position_embedding_type": "sans_pos",
|
| 62 |
+
"repad_logits_with_grad": false,
|
| 63 |
+
"rope_parameters": {
|
| 64 |
+
"full_attention": {
|
| 65 |
+
"rope_theta": 160000,
|
| 66 |
+
"rope_type": "default"
|
| 67 |
+
},
|
| 68 |
+
"sliding_attention": {
|
| 69 |
+
"rope_theta": 160000,
|
| 70 |
+
"rope_type": "default"
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
"sep_token_id": 1,
|
| 74 |
+
"sparse_pred_ignore_index": -100,
|
| 75 |
+
"sparse_prediction": false,
|
| 76 |
+
"tie_word_embeddings": true,
|
| 77 |
+
"transformers_version": "5.0.0",
|
| 78 |
+
"vocab_size": 256000
|
| 79 |
+
}
|
model.mlpackage/Data/com.apple.CoreML/model.mlmodel
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d179f5ebd939d34814e220af2dad78de8ad03e4b07a18831e0bc36451ef6188c
|
| 3 |
+
size 304523
|
model.mlpackage/Data/com.apple.CoreML/weights/weight.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:de5ceb1a6c358e1dd26d218fda93a0297181a19e518bdae73608485fe0b91872
|
| 3 |
+
size 643843328
|
model.mlpackage/Manifest.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"fileFormatVersion": "1.0.0",
|
| 3 |
+
"itemInfoEntries": {
|
| 4 |
+
"7AFB6ACE-0063-4199-9CFE-002C433838FC": {
|
| 5 |
+
"author": "com.apple.CoreML",
|
| 6 |
+
"description": "CoreML Model Specification",
|
| 7 |
+
"name": "model.mlmodel",
|
| 8 |
+
"path": "com.apple.CoreML/model.mlmodel"
|
| 9 |
+
},
|
| 10 |
+
"AFA3FB92-257D-414E-8DCB-8FD600D65BAA": {
|
| 11 |
+
"author": "com.apple.CoreML",
|
| 12 |
+
"description": "CoreML Model Weights",
|
| 13 |
+
"name": "weights",
|
| 14 |
+
"path": "com.apple.CoreML/weights"
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
+
"rootModelIdentifier": "7AFB6ACE-0063-4199-9CFE-002C433838FC"
|
| 18 |
+
}
|
rl_agent_config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"encoder": "jhu-clsp/mmBERT-base",
|
| 3 |
+
"head_layers": 2,
|
| 4 |
+
"max_len": 1024,
|
| 5 |
+
"head_max_len": 256,
|
| 6 |
+
"max_prefixes": 6,
|
| 7 |
+
"act_costs": {
|
| 8 |
+
"escalate": 0.5
|
| 9 |
+
},
|
| 10 |
+
"cost_wrong_act": 3.0,
|
| 11 |
+
"amp_dtype": "bf16",
|
| 12 |
+
"model_name": "rl-agent",
|
| 13 |
+
"temperature": [
|
| 14 |
+
1.0,
|
| 15 |
+
1.0,
|
| 16 |
+
1.0
|
| 17 |
+
],
|
| 18 |
+
"temperature_by_options": {},
|
| 19 |
+
"training": {
|
| 20 |
+
"updates": 15987,
|
| 21 |
+
"epochs_completed": 4,
|
| 22 |
+
"hours": 4.97,
|
| 23 |
+
"world_size": 1,
|
| 24 |
+
"fine_tuned_from_checkpoint": false
|
| 25 |
+
}
|
| 26 |
+
}
|
tokenizer/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f
|
| 3 |
+
size 34363188
|
tokenizer/tokenizer_config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<bos>",
|
| 3 |
+
"clean_up_tokenization_spaces": false,
|
| 4 |
+
"cls_token": "<bos>",
|
| 5 |
+
"eos_token": "<eos>",
|
| 6 |
+
"extra_special_tokens": {
|
| 7 |
+
"extra_0": "<start_of_turn>",
|
| 8 |
+
"extra_1": "<end_of_turn>"
|
| 9 |
+
},
|
| 10 |
+
"mask_token": "<mask>",
|
| 11 |
+
"model_input_names": [
|
| 12 |
+
"input_ids",
|
| 13 |
+
"attention_mask"
|
| 14 |
+
],
|
| 15 |
+
"model_max_length": 8192,
|
| 16 |
+
"pad_token": "<pad>",
|
| 17 |
+
"padding_side": "right",
|
| 18 |
+
"sep_token": "<eos>",
|
| 19 |
+
"spaces_between_special_tokens": false,
|
| 20 |
+
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 21 |
+
"unk_token": "<unk>"
|
| 22 |
+
}
|
validation.json
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"environment": {
|
| 3 |
+
"created_at": "2026-09-20T03:20:11.091953+00:00",
|
| 4 |
+
"chip": "Apple M3 Max",
|
| 5 |
+
"memory_bytes": 137438953472,
|
| 6 |
+
"os": "macOS-27.2-arm64-arm-64bit",
|
| 7 |
+
"python": "3.12.13",
|
| 8 |
+
"packages": {
|
| 9 |
+
"coremltools": "9.0",
|
| 10 |
+
"numpy": "2.1.3",
|
| 11 |
+
"torch": "2.7.0",
|
| 12 |
+
"tokenizers": "0.23.2",
|
| 13 |
+
"mlx": "0.32.2",
|
| 14 |
+
"laya-mlx": "0.1.0"
|
| 15 |
+
},
|
| 16 |
+
"source_sha256": "48f7d107ba44feedfa8f643e4c7808b1e540652d4e8275840336e8adca28f4f2"
|
| 17 |
+
},
|
| 18 |
+
"repository": "aac6fef/laya-multilingual-coreml-snake",
|
| 19 |
+
"format": "laya-coreml",
|
| 20 |
+
"shape": {
|
| 21 |
+
"batch_size": 3,
|
| 22 |
+
"max_length": 64,
|
| 23 |
+
"min_length": 16,
|
| 24 |
+
"default_length": 64,
|
| 25 |
+
"max_options": 4,
|
| 26 |
+
"flexible": false,
|
| 27 |
+
"mode": "fixed",
|
| 28 |
+
"lengths": null
|
| 29 |
+
},
|
| 30 |
+
"compute_units": "cpu_gpu",
|
| 31 |
+
"load_seconds": 1.695275666002999,
|
| 32 |
+
"source_weights_sha256": "9d628fd971b700382ac6f65920a86f149777b2e748e0c955fb3b19695aa8f204",
|
| 33 |
+
"package_sha256": "85a738c18147a7485ea738b6238f43ab7d1740b58d8af37b83d8878f64ab563b",
|
| 34 |
+
"reference_sha256": "27642bf5f16e1881514a65f91d2ba986fce786b832e60ed1a35fa44d1bfdd682",
|
| 35 |
+
"bundle_files_verified": true,
|
| 36 |
+
"cases": [
|
| 37 |
+
{
|
| 38 |
+
"name": "email",
|
| 39 |
+
"skipped": "outside bundle capacity"
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"name": "en",
|
| 43 |
+
"skipped": "outside bundle capacity"
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"name": "zh",
|
| 47 |
+
"questions": 3,
|
| 48 |
+
"argmax_agreements": 3,
|
| 49 |
+
"probability_max_abs_error": 0.0004650094824689699,
|
| 50 |
+
"action_probability_max_abs_error": 0.0
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"name": "de",
|
| 54 |
+
"skipped": "outside bundle capacity"
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "fr",
|
| 58 |
+
"skipped": "outside bundle capacity"
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"name": "es",
|
| 62 |
+
"skipped": "outside bundle capacity"
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
"name": "hi",
|
| 66 |
+
"skipped": "outside bundle capacity"
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"name": "ja",
|
| 70 |
+
"questions": 3,
|
| 71 |
+
"argmax_agreements": 3,
|
| 72 |
+
"probability_max_abs_error": 8.419404114012874e-05,
|
| 73 |
+
"action_probability_max_abs_error": 0.0
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"name": "ru",
|
| 77 |
+
"skipped": "outside bundle capacity"
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"name": "empty_state",
|
| 81 |
+
"questions": 3,
|
| 82 |
+
"argmax_agreements": 3,
|
| 83 |
+
"probability_max_abs_error": 0.00039023162459189686,
|
| 84 |
+
"action_probability_max_abs_error": 0.0
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"name": "long",
|
| 88 |
+
"skipped": "outside bundle capacity"
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"name": "conversation",
|
| 92 |
+
"skipped": "outside bundle capacity"
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"name": "mask_literals",
|
| 96 |
+
"questions": 3,
|
| 97 |
+
"argmax_agreements": 3,
|
| 98 |
+
"probability_max_abs_error": 0.0013082645248925218,
|
| 99 |
+
"action_probability_max_abs_error": 0.0
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"name": "many_questions",
|
| 103 |
+
"skipped": "outside bundle capacity"
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"name": "structured",
|
| 107 |
+
"skipped": "outside bundle capacity"
|
| 108 |
+
},
|
| 109 |
+
{
|
| 110 |
+
"name": "twenty_options",
|
| 111 |
+
"skipped": "outside bundle capacity"
|
| 112 |
+
}
|
| 113 |
+
],
|
| 114 |
+
"passed": true,
|
| 115 |
+
"questions": 12,
|
| 116 |
+
"argmax_agreements": 12,
|
| 117 |
+
"probability_max_abs_error": 0.0013082645248925218,
|
| 118 |
+
"action_probability_max_abs_error": 0.0,
|
| 119 |
+
"stability": {
|
| 120 |
+
"calls": 100,
|
| 121 |
+
"identical_rounded_results": true
|
| 122 |
+
},
|
| 123 |
+
"gate": {
|
| 124 |
+
"all_argmax_agree": true,
|
| 125 |
+
"max_probability_error": 0.02,
|
| 126 |
+
"max_action_probability_error": 0.02,
|
| 127 |
+
"finite": true,
|
| 128 |
+
"stable": true
|
| 129 |
+
}
|
| 130 |
+
}
|