lsb commited on
Commit
fec0769
·
verified ·
1 Parent(s): 82ed37b

initial 4-bit ONNX export (DiT + T5Gemma encoder + SAME-S decoder)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,12 @@ 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
+ onnx/decoder_q4_chunk_0.data filter=lfs diff=lfs merge=lfs -text
37
+ onnx/dit_q4_chunk_0.data filter=lfs diff=lfs merge=lfs -text
38
+ onnx/dit_q4_chunk_1.data filter=lfs diff=lfs merge=lfs -text
39
+ onnx/dit_q4_chunk_2.data filter=lfs diff=lfs merge=lfs -text
40
+ onnx/dit_q4_chunk_3.data filter=lfs diff=lfs merge=lfs -text
41
+ onnx/text_encoder_q4_chunk_0.data filter=lfs diff=lfs merge=lfs -text
42
+ onnx/text_encoder_q4_chunk_1.data filter=lfs diff=lfs merge=lfs -text
43
+ onnx/text_encoder_q4_chunk_2.data filter=lfs diff=lfs merge=lfs -text
44
+ tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
LICENSE.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ STABILITY AI COMMUNITY LICENSE AGREEMENT
2
+
3
+ Last Updated: July 5, 2024
4
+
5
+ 1. INTRODUCTION
6
+
7
+ This Agreement applies to any individual person or entity (“You”, “Your” or “Licensee”) that uses or distributes any portion or element of the Stability AI Materials or Derivative Works thereof for any Research & Non-Commercial or Commercial purpose. Capitalized terms not otherwise defined herein are defined in Section V below.
8
+
9
+ This Agreement is intended to allow research, non-commercial, and limited commercial uses of the Models free of charge. In order to ensure that certain limited commercial uses of the Models continue to be allowed, this Agreement preserves free access to the Models for people or organizations generating annual revenue of less than US $1,000,000 (or local currency equivalent).
10
+
11
+ By clicking “I Accept” or by using or distributing or using any portion or element of the Stability Materials or Derivative Works, You agree that You have read, understood and are bound by the terms of this Agreement. If You are acting on behalf of a company, organization or other entity, then “You” includes you and that entity, and You agree that You: (i) are an authorized representative of such entity with the authority to bind such entity to this Agreement, and (ii) You agree to the terms of this Agreement on that entity’s behalf.
12
+
13
+ 2. RESEARCH & NON-COMMERCIAL USE LICENSE
14
+
15
+ Subject to the terms of this Agreement, Stability AI grants You a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable and royalty-free limited license under Stability AI’s intellectual property or other rights owned by Stability AI embodied in the Stability AI Materials to use, reproduce, distribute, and create Derivative Works of, and make modifications to, the Stability AI Materials for any Research or Non-Commercial Purpose. “Research Purpose” means academic or scientific advancement, and in each case, is not primarily intended for commercial advantage or monetary compensation to You or others. “Non-Commercial Purpose” means any purpose other than a Research Purpose that is not primarily intended for commercial advantage or monetary compensation to You or others, such as personal use (i.e., hobbyist) or evaluation and testing.
16
+
17
+ 3. COMMERCIAL USE LICENSE
18
+
19
+ Subject to the terms of this Agreement (including the remainder of this Section III), Stability AI grants You a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable and royalty-free limited license under Stability AI’s intellectual property or other rights owned by Stability AI embodied in the Stability AI Materials to use, reproduce, distribute, and create Derivative Works of, and make modifications to, the Stability AI Materials for any Commercial Purpose. “Commercial Purpose” means any purpose other than a Research Purpose or Non-Commercial Purpose that is primarily intended for commercial advantage or monetary compensation to You or others, including but not limited to, (i) creating, modifying, or distributing Your product or service, including via a hosted service or application programming interface, and (ii) for Your business’s or organization’s internal operations.
20
+ If You are using or distributing the Stability AI Materials for a Commercial Purpose, You must register with Stability AI at (https://stability.ai/community-license). If at any time You or Your Affiliate(s), either individually or in aggregate, generate more than USD $1,000,000 in annual revenue (or the equivalent thereof in Your local currency), regardless of whether that revenue is generated directly or indirectly from the Stability AI Materials or Derivative Works, any licenses granted to You under this Agreement shall terminate as of such date. You must request a license from Stability AI at (https://stability.ai/enterprise) , which Stability AI may grant to You in its sole discretion. If you receive Stability AI Materials, or any Derivative Works thereof, from a Licensee as part of an integrated end user product, then Section III of this Agreement will not apply to you.
21
+
22
+ 4. GENERAL TERMS
23
+
24
+ Your Research, Non-Commercial, and Commercial License(s) under this Agreement are subject to the following terms.
25
+ a. Distribution & Attribution. If You distribute or make available the Stability AI Materials or a Derivative Work to a third party, or a product or service that uses any portion of them, You shall: (i) provide a copy of this Agreement to that third party, (ii) retain the following attribution notice within a "Notice" text file distributed as a part of such copies: "This Stability AI Model is licensed under the Stability AI Community License, Copyright © Stability AI Ltd. All Rights Reserved”, and (iii) prominently display “Powered by Stability AI” on a related website, user interface, blogpost, about page, or product documentation. If You create a Derivative Work, You may add your own attribution notice(s) to the “Notice” text file included with that Derivative Work, provided that You clearly indicate which attributions apply to the Stability AI Materials and state in the “Notice” text file that You changed the Stability AI Materials and how it was modified.
26
+ b. Use Restrictions. Your use of the Stability AI Materials and Derivative Works, including any output or results of the Stability AI Materials or Derivative Works, must comply with applicable laws and regulations (including Trade Control Laws and equivalent regulations) and adhere to the Documentation and Stability AI’s AUP, which is hereby incorporated by reference. Furthermore, You will not use the Stability AI Materials or Derivative Works, or any output or results of the Stability AI Materials or Derivative Works, to create or improve any foundational generative AI model (excluding the Models or Derivative Works).
27
+ c. Intellectual Property.
28
+ (i) Trademark License. No trademark licenses are granted under this Agreement, and in connection with the Stability AI Materials or Derivative Works, You may not use any name or mark owned by or associated with Stability AI or any of its Affiliates, except as required under Section IV(a) herein.
29
+ (ii) Ownership of Derivative Works. As between You and Stability AI, You are the owner of Derivative Works You create, subject to Stability AI’s ownership of the Stability AI Materials and any Derivative Works made by or for Stability AI.
30
+ (iii) Ownership of Outputs. As between You and Stability AI, You own any outputs generated from the Models or Derivative Works to the extent permitted by applicable law.
31
+ (iv) Disputes. If You or Your Affiliate(s) institute litigation or other proceedings against Stability AI (including a cross-claim or counterclaim in a lawsuit) alleging that the Stability AI Materials, Derivative Works or associated outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by You, then any licenses granted to You under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Stability AI from and against any claim by any third party arising out of or related to Your use or distribution of the Stability AI Materials or Derivative Works in violation of this Agreement.
32
+ (v) Feedback. From time to time, You may provide Stability AI with verbal and/or written suggestions, comments or other feedback related to Stability AI’s existing or prospective technology, products or services (collectively, “Feedback”). You are not obligated to provide Stability AI with Feedback, but to the extent that You do, You hereby grant Stability AI a perpetual, irrevocable, royalty-free, fully-paid, sub-licensable, transferable, non-exclusive, worldwide right and license to exploit the Feedback in any manner without restriction. Your Feedback is provided “AS IS” and You make no warranties whatsoever about any Feedback.
33
+ d. Disclaimer Of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE STABILITY AI MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OR LAWFULNESS OF USING OR REDISTRIBUTING THE STABILITY AI MATERIALS, DERIVATIVE WORKS OR ANY OUTPUT OR RESULTS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE STABILITY AI MATERIALS, DERIVATIVE WORKS AND ANY OUTPUT AND RESULTS.
34
+ e. Limitation Of Liability. IN NO EVENT WILL STABILITY AI OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF STABILITY AI OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
35
+ f. Term And Termination. The term of this Agreement will commence upon Your acceptance of this Agreement or access to the Stability AI Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Stability AI may terminate this Agreement if You are in breach of any term or condition of this Agreement. Upon termination of this Agreement, You shall delete and cease use of any Stability AI Materials or Derivative Works. Section IV(d), (e), and (g) shall survive the termination of this Agreement.
36
+ g. Governing Law. This Agreement will be governed by and constructed in accordance with the laws of the United States and the State of California without regard to choice of law principles, and the UN Convention on Contracts for International Sale of Goods does not apply to this Agreement.
37
+
38
+ 5. DEFINITIONS
39
+
40
+ “Affiliate(s)” means any entity that directly or indirectly controls, is controlled by, or is under common control with the subject entity; for purposes of this definition, “control” means direct or indirect ownership or control of more than 50% of the voting interests of the subject entity.
41
+
42
+ "Agreement" means this Stability AI Community License Agreement.
43
+
44
+ “AUP” means the Stability AI Acceptable Use Policy available at (https://stability.ai/use-policy), as may be updated from time to time.
45
+
46
+ "Derivative Work(s)” means (a) any derivative work of the Stability AI Materials as recognized by U.S. copyright laws and (b) any modifications to a Model, and any other model created which is based on or derived from the Model or the Model’s output, including “fine tune” and “low-rank adaptation” models derived from a Model or a Model’s output, but do not include the output of any Model.
47
+
48
+ “Documentation” means any specifications, manuals, documentation, and other written information provided by Stability AI related to the Software or Models.
49
+
50
+ “Model(s)" means, collectively, Stability AI’s proprietary models and algorithms, including machine-learning models, trained model weights and other elements of the foregoing listed on Stability’s Core Models Webpage available at (https://stability.ai/core-models), as may be updated from time to time.
51
+
52
+ "Stability AI" or "we" means Stability AI Ltd. and its Affiliates.
53
+
54
+ "Software" means Stability AI’s proprietary software made available under this Agreement now or in the future.
55
+
56
+ “Stability AI Materials” means, collectively, Stability’s proprietary Models, Software and Documentation (and any portion or combination thereof) made available under this Agreement.
57
+
58
+ “Trade Control Laws” means any applicable U.S. and non-U.S. export control and trade sanctions laws and regulations.
LICENSE_GEMMA.md ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Gemma Terms of Use
2
+
3
+ The terms below apply to Gemma models listed in the Appendix at bottom of this page. For Gemma 4 terms, see the [Gemma 4 license](https://ai.google.dev/gemma/apache_2).
4
+
5
+ Last modified: April 1, 2026
6
+
7
+ By using, reproducing, modifying, distributing, performing or displaying any
8
+ portion or element of Gemma, Model Derivatives including via any Hosted Service,
9
+ (each as defined below) (collectively, the "**Gemma Services**") or otherwise
10
+ accepting the terms of this Agreement, you agree to be bound by this Agreement.
11
+
12
+ ## Section 1: DEFINITIONS
13
+
14
+ ### 1.1 Definitions
15
+
16
+ (a) "**Agreement** " or "**Gemma Terms of Use**" means these terms and conditions
17
+ that govern the use, reproduction, Distribution or modification of the Gemma
18
+ Services and any terms and conditions incorporated by reference.
19
+
20
+ (b) "**Distribution** " or "**Distribute** " means any transmission, publication,
21
+ or other sharing of Gemma or Model Derivatives to a third party, including by
22
+ providing or making Gemma or its functionality available as a hosted service via
23
+ API, web access, or any other electronic or remote means ("**Hosted Service**").
24
+
25
+ (c) "**Gemma** " means the set of machine learning language models, trained model
26
+ weights and parameters identified in the [Appendix](https://ai.google.dev/gemma/terms#appendix),
27
+ regardless of the source that you obtained it from.
28
+
29
+ (d) "**Google**" means Google LLC.
30
+
31
+ (e) "**Model Derivatives**" means all (i) modifications to Gemma, (ii) works based
32
+ on Gemma, or (iii) any other machine learning model which is created by transfer
33
+ of patterns of the weights, parameters, operations, or Output of Gemma, to that
34
+ model in order to cause that model to perform similarly to Gemma, including
35
+ distillation methods that use intermediate data representations or methods based
36
+ on the generation of synthetic data Outputs by Gemma for training that model.
37
+ For clarity, Outputs are not deemed Model Derivatives.
38
+
39
+ (f) "**Output**" means the information content output of Gemma or a Model
40
+ Derivative that results from operating or otherwise using Gemma or the Model
41
+ Derivative, including via a Hosted Service.
42
+
43
+ ### 1.2
44
+
45
+ As used in this Agreement, "**including** " means
46
+ "**including without limitation**".
47
+
48
+ ## Section 2: ELIGIBILITY AND USAGE
49
+
50
+ ### 2.1 Eligibility
51
+
52
+ You represent and warrant that you have the legal capacity to enter into this
53
+ Agreement (including being of sufficient age of consent). If you are accessing
54
+ or using any of the Gemma Services for or on behalf of a legal entity, (a) you
55
+ are entering into this Agreement on behalf of yourself and that legal entity,
56
+ (b) you represent and warrant that you have the authority to act on behalf of
57
+ and bind that entity to this Agreement and (c) references to "**you** " or
58
+ "**your**" in the remainder of this Agreement refers to both you (as an
59
+ individual) and that entity.
60
+
61
+ ### 2.2 Use
62
+
63
+ You may use, reproduce, modify, Distribute, perform or display any of the Gemma
64
+ Services only in accordance with the terms of this Agreement, and must not
65
+ violate (or encourage or permit anyone else to violate) any term of this
66
+ Agreement.
67
+
68
+ ## Section 3: DISTRIBUTION AND RESTRICTIONS
69
+
70
+ ### 3.1 Distribution and Redistribution
71
+
72
+ You may reproduce or Distribute copies of Gemma or Model Derivatives if you meet
73
+ all of the following conditions:
74
+
75
+ 1. You must include the use restrictions referenced in Section 3.2 as an enforceable provision in any agreement (e.g., license agreement, terms of use, etc.) governing the use and/or distribution of Gemma or Model Derivatives and you must provide notice to subsequent users you Distribute to that Gemma or Model Derivatives are subject to the use restrictions in Section 3.2.
76
+ 2. You must provide all third party recipients of Gemma or Model Derivatives a copy of this Agreement.
77
+ 3. You must cause any modified files to carry prominent notices stating that you modified the files.
78
+ 4. All Distributions (other than through a Hosted Service) must be accompanied by a "**Notice** " text file that contains the following notice: "**Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms**".
79
+
80
+ You may add your own intellectual property statement to your modifications and,
81
+ except as set forth in this Section, may provide additional or different terms
82
+ and conditions for use, reproduction, or Distribution of your modifications, or
83
+ for any such Model Derivatives as a whole, provided your use, reproduction,
84
+ modification, Distribution, performance, and display of Gemma otherwise complies
85
+ with the terms and conditions of this Agreement. Any additional or different
86
+ terms and conditions you impose must not conflict with the terms of this
87
+ Agreement.
88
+
89
+ ### 3.2 Use Restrictions
90
+
91
+ You must not use any of the Gemma Services:
92
+
93
+ 1. for the restricted uses set forth in the Gemma Prohibited Use Policy at [ai.google.dev/gemma/prohibited_use_policy](https://ai.google.dev/gemma/prohibited_use_policy) ("**Prohibited Use Policy**"), which is hereby incorporated by reference into this Agreement; or
94
+ 2. in violation of applicable laws and regulations.
95
+
96
+ To the maximum extent permitted by law, Google reserves the right to restrict
97
+ (remotely or otherwise) usage of any of the Gemma Services that Google
98
+ reasonably believes are in violation of this Agreement.
99
+
100
+ ### 3.3 Generated Output
101
+
102
+ Google claims no rights in Outputs you generate using Gemma. You and your users
103
+ are solely responsible for Outputs and their subsequent uses.
104
+
105
+ ## Section 4: ADDITIONAL PROVISIONS
106
+
107
+ ### 4.1 Updates
108
+
109
+ Google may update Gemma from time to time.
110
+
111
+ ### 4.2 Trademarks
112
+
113
+ Nothing in this Agreement grants you any rights to use Google's trademarks,
114
+ trade names, logos or to otherwise suggest endorsement or misrepresent the
115
+ relationship between you and Google. Google reserves any rights not expressly
116
+ granted herein.
117
+
118
+ ### 4.3 DISCLAIMER OF WARRANTY
119
+
120
+ UNLESS REQUIRED BY APPLICABLE LAW, THE GEMMA SERVICES, AND OUTPUTS, ARE PROVIDED
121
+ ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
122
+ EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OR CONDITIONS OF TITLE,
123
+ NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE
124
+ SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, REPRODUCING,
125
+ MODIFYING, PERFORMING, DISPLAYING OR DISTRIBUTING ANY OF THE GEMMA SERVICES
126
+ OR OUTPUTS AND ASSUME ANY AND ALL RISKS ASSOCIATED WITH YOUR USE OR DISTRIBUTION
127
+ OF ANY OF THE GEMMA SERVICES OR OUTPUTS AND YOUR EXERCISE OF RIGHTS AND
128
+ PERMISSIONS UNDER THIS AGREEMENT.
129
+
130
+ ### 4.4 LIMITATION OF LIABILITY
131
+
132
+ TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO
133
+ LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY,
134
+ CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW, SHALL GOOGLE OR ITS
135
+ AFFILIATES BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT,
136
+ SPECIAL, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR LOST
137
+ PROFITS OF ANY KIND ARISING FROM THIS AGREEMENT OR RELATED TO, ANY OF THE GEMMA
138
+ SERVICES OR OUTPUTS EVEN IF GOOGLE OR ITS AFFILIATES HAVE BEEN ADVISED OF THE
139
+ POSSIBILITY OF SUCH DAMAGES.
140
+
141
+ ### 4.5 Term, Termination, and Survival
142
+
143
+ The term of this Agreement will commence upon your acceptance of this Agreement
144
+ (including acceptance by your use, modification, or Distribution, reproduction,
145
+ performance or display of any portion or element of the Gemma Services) and will
146
+ continue in full force and effect until terminated in accordance with the terms
147
+ of this Agreement. Google may terminate this Agreement if you are in breach of
148
+ any term of this Agreement. Upon termination of this Agreement, you must delete
149
+ and cease use and Distribution of all copies of Gemma and Model Derivatives in
150
+ your possession or control. Sections 1, 2.1, 3.3, 4.2 to 4.9 shall survive the
151
+ termination of this Agreement.
152
+
153
+ ### 4.6 Governing Law and Jurisdiction
154
+
155
+ This Agreement will be governed by the laws of the State of California without
156
+ regard to choice of law principles. The UN Convention on Contracts for the
157
+ International Sale of Goods does not apply to this Agreement. The state and
158
+ federal courts of Santa Clara County, California shall have exclusive
159
+ jurisdiction of any dispute arising out of this Agreement.
160
+
161
+ ### 4.7 Severability
162
+
163
+ If any provision of this Agreement is held to be invalid, illegal or
164
+ unenforceable, the remaining provisions shall be unaffected thereby and remain
165
+ valid as if such provision had not been set forth herein.
166
+
167
+ ### 4.8 Entire Agreement
168
+
169
+ This Agreement states all the terms agreed between the parties and supersedes
170
+ all other agreements between the parties as of the date of acceptance relating
171
+ to its subject matter.
172
+
173
+ ### 4.9 No Waiver
174
+
175
+ Google will not be treated as having waived any rights by not exercising (or
176
+ delaying the exercise of) any rights under this Agreement.
177
+
178
+ ## Appendix
179
+
180
+ - [Gemma 1](https://ai.google.dev/gemma/docs/core/model_card)
181
+ - [Gemma 1.1](https://ai.google.dev/gemma/docs/core/model_card)
182
+ - [Gemma 2](https://ai.google.dev/gemma/docs/core/model_card_2)
183
+ - [Gemma 3](https://ai.google.dev/gemma/docs/core/model_card_3)
184
+ - [Gemma 3n](https://ai.google.dev/gemma/docs/3n)
185
+ - [FunctionGemma](https://ai.google.dev/gemma/docs/functiongemma)
186
+ - [EmbeddingGemma](https://ai.google.dev/gemma/docs/embeddinggemma)
187
+ - [PaliGemma](https://ai.google.dev/gemma/docs/paligemma/model-card)
188
+ - [PaliGemma 2](https://ai.google.dev/gemma/docs/paligemma/model-card-2)
189
+ - [ShieldGemma](https://ai.google.dev/gemma/docs/shieldgemma/model_card)
190
+ - [ShieldGemma 2](https://ai.google.dev/gemma/docs/shieldgemma/model_card_2)
191
+ - [CodeGemma](https://ai.google.dev/gemma/docs/codegemma/model_card)
192
+ - [CodeGemma 1.1](https://ai.google.dev/gemma/docs/codegemma/model_card)
193
+ - [Gemma 2 JPN](https://huggingface.co/google/gemma-2-2b-jpn-it)
194
+ - [DataGemma RIG](https://www.kaggle.com/models/google/datagemma-rig)
195
+ - [DataGemma RAG](https://www.kaggle.com/models/google/datagemma-rag)
196
+ - [RecurrentGemma](https://ai.google.dev/gemma/docs/recurrentgemma/model_card)
197
+ - [Gemma Scope](https://ai.google.dev/gemma/docs/gemma_scope)
198
+ - [Gemma-APS](https://ai.google.dev/gemma/docs/gemma-aps)
199
+ - [T5Gemma](https://www.kaggle.com/models/google/t5gemma)
200
+ - [VaultGemma](https://www.kaggle.com/models/google/vaultgemma)
201
+ - [FunctionGemma](https://www.kaggle.com/models/google/functiongemma)
202
+ - [T5Gemma 2](https://www.kaggle.com/models/google/t5gemma-2)
203
+ - [TranslateGemma](https://www.kaggle.com/models/google/translategemma)
204
+
205
+ > [!NOTE]
206
+ > **Note:** Previous versions of these Terms are [archived here](https://ai.google.dev/gemma/terms-archive).
NOTICE ADDED
@@ -0,0 +1 @@
 
 
1
+ Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: stability-ai-community-license
4
+ license_link: LICENSE.md
5
+ tags:
6
+ - audio
7
+ - text-to-audio
8
+ - music-generation
9
+ - stable-audio
10
+ - onnx
11
+ - q4
12
+ - matmulnbits
13
+ - transformers.js
14
+ - onnxruntime-web
15
+ library_name: onnxruntime
16
+ base_model: stabilityai/stable-audio-3-small-music
17
+ ---
18
+
19
+ # stable-audio-3-small-music — 4-bit ONNX bundle for the browser
20
+
21
+ Quantized **ONNX** export of [`stabilityai/stable-audio-3-small-music`](https://huggingface.co/stabilityai/stable-audio-3-small-music) (Stability AI Community License) intended to run end-to-end in a web browser via [`onnxruntime-web`](https://www.npmjs.com/package/onnxruntime-web).
22
+
23
+ All weight-bearing MatMul/Linear nodes are quantized to **int4 MatMulNBits** with `block_size=16`, embedding tables are quantized as **GatherBlockQuantized**, and remaining initializers (LayerNorm/RMSNorm scales, biases, Conv1d kernels) stay in fp32. External-data sidecars are split into multiple files ≤ 100 MB each.
24
+
25
+ The bundle is a drop-in for the demo at <https://github.com/lsb/stable-audio-3-small-music-onnx> (or whatever public copy lives alongside it).
26
+
27
+ ## Files
28
+
29
+ ```
30
+ onnx/
31
+ text_encoder_q4.onnx + text_encoder_q4_chunk_{0..N}.data
32
+ dit_q4.onnx + dit_q4_chunk_{0..N}.data
33
+ decoder_q4.onnx + decoder_q4_chunk_{0..N}.data
34
+ *_chunks.json browser-side weight manifest
35
+ tokenizer/ T5Gemma tokenizer files (drop-in for @huggingface/transformers)
36
+ number_conditioner.npz weights for the duration scalar embedder
37
+ config.json runtime config consumed by the browser
38
+ LICENSE.md LICENSE_GEMMA.md NOTICE
39
+ ```
40
+
41
+ Total bundle size: about **640 MB** of int4 weights spread across 8 chunks.
42
+
43
+ ## Inference shape
44
+
45
+ - Latent: `(1, 256, T_lat)` where `T_lat = ceil((seconds + 6) * 44100 / 8192) * 2`
46
+ - Cross-attention conditioning: `(1, 257, 768)` (256 T5Gemma tokens + 1 duration embedding)
47
+ - Global conditioning (adaLN): `(1, 768)` (duration embedding)
48
+ - Local-add conditioning (inpaint): `(1, 257, T_lat)` (zeros for plain text-to-audio)
49
+ - Padding mask: `(1, T_lat)` boolean
50
+ - Output (decoder): `(1, 2, T_lat * 4096)` stereo audio at 44.1 kHz, clamped to [-1, 1]
51
+
52
+ ## Sampler
53
+
54
+ `rf_denoiser` objective with the **pingpong** sampler (5 lines of arithmetic — ported to JS in the demo):
55
+
56
+ ```
57
+ denoised = x - t_curr * dit(x, t_curr, …)
58
+ x = (1 - t_next) * denoised + t_next * randn_like(x)
59
+ ```
60
+
61
+ Schedule comes from `LogSNRShift(rate=0, anchor_logsnr=-6.2, logsnr_end=2.0)` — sequence-length-invariant, so the same closed-form formula works for any duration. Default 8 steps. CFG is disabled at inference time (`cfg_scale=1.0` in the original).
62
+
63
+ ## Browser usage (sketch)
64
+
65
+ ```html
66
+ <script type="module">
67
+ import * as ort from "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.21.0/dist/esm/ort.min.js";
68
+ import { AutoTokenizer } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers";
69
+ ort.env.wasm.numThreads = 1;
70
+
71
+ const base = "https://huggingface.co/lsb/stable-audio-3-small-music-onnx/resolve/main";
72
+ const manifest = await fetch(`${base}/onnx/dit_q4_chunks.json`).then(r => r.json());
73
+ const ditBuf = await fetch(`${base}/onnx/dit_q4.onnx`).then(r => r.arrayBuffer());
74
+ const externalData = await Promise.all(manifest.chunks.map(async c => ({
75
+ path: c.name,
76
+ data: new Uint8Array(await (await fetch(`${base}/onnx/${c.name}`)).arrayBuffer()),
77
+ })));
78
+ const sess = await ort.InferenceSession.create(new Uint8Array(ditBuf), {
79
+ executionProviders: ["wasm"],
80
+ externalData,
81
+ });
82
+ </script>
83
+ ```
84
+
85
+ See the demo source for the full pipeline (tokenizer → text encoder → pingpong loop → decoder → WAV).
86
+
87
+ ## Quality / performance
88
+
89
+ - Per-graph q4 vs fp32 SNR (single forward pass): DiT ~10 dB, decoder ~15 dB, text encoder ~13 dB.
90
+ - End-to-end vs the PyTorch fp32 reference: envelope correlation ≈ 0.88 on the same prompt/seed — same musical structure, slightly more high-frequency artifacts.
91
+ - Single-threaded WASM on an M-series Mac: roughly 60–120 s wall-clock for a 10 s clip at 8 steps. WebGPU would be much faster but is intentionally not used here so the bundle works from any static host.
92
+
93
+ ## License
94
+
95
+ This bundle inherits the **Stability AI Community License** from the upstream weights. The T5Gemma encoder weights additionally fall under Google's **Gemma Terms of Use**. Both license files are included verbatim; see `NOTICE` for the combined attribution.
config.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "stable-audio-3-small-music",
3
+ "upstream": "https://huggingface.co/stabilityai/stable-audio-3-small-music",
4
+ "license": "Stability AI Community License",
5
+ "sample_rate": 44100,
6
+ "io_channels": 256,
7
+ "downsampling_ratio": 4096,
8
+ "cond_dim": 768,
9
+ "global_cond_dim": 768,
10
+ "local_add_cond_dim": 257,
11
+ "cross_attn_seq_len": 257,
12
+ "text_max_length": 256,
13
+ "audio_align": 8192,
14
+ "default_seconds": 10,
15
+ "default_steps": 8,
16
+ "schedule": {
17
+ "type": "logsnr",
18
+ "rate": 0,
19
+ "anchor_logsnr": -6.2,
20
+ "logsnr_end": 2.0
21
+ },
22
+ "duration_embedder": {
23
+ "type": "number_conditioner_expo_fourier",
24
+ "dim": 256,
25
+ "f_min": 0.5,
26
+ "f_max": 10000.0,
27
+ "weights": "number_conditioner.npz",
28
+ "min_val": 0,
29
+ "max_val": 384
30
+ },
31
+ "graphs": {
32
+ "text_encoder": {
33
+ "manifest": "onnx/text_encoder_q4_chunks.json",
34
+ "padding_mode": "learned",
35
+ "hidden_size": 768
36
+ },
37
+ "dit": {
38
+ "manifest": "onnx/dit_q4_chunks.json",
39
+ "depth": 20,
40
+ "embed_dim": 1024,
41
+ "num_memory_tokens": 64
42
+ },
43
+ "decoder": {
44
+ "manifest": "onnx/decoder_q4_chunks.json",
45
+ "audio_channels": 2
46
+ }
47
+ }
48
+ }
number_conditioner.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:195a00bb0009a47d1fbfed84e3c53481b8e62de68927fa7a80d757e076316b3a
3
+ size 790548
onnx/decoder_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c096325b7909ec84ada0b403f66e05c10745799f8ae5daee1f2739d6ff9fccaf
3
+ size 1653261
onnx/decoder_q4_chunk_0.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d30ef4db0559ac0cb01d1c92816c6a8fceeb5736194636b3dd8aff2a2c7d2e92
3
+ size 44894208
onnx/decoder_q4_chunks.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "decoder_q4.onnx",
3
+ "chunks": [
4
+ {
5
+ "name": "decoder_q4_chunk_0.data",
6
+ "size": 44894208
7
+ }
8
+ ],
9
+ "total_weight_mb": 44.89
10
+ }
onnx/dit_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28bd338559828e59a24a6a53b0c572be812b6b37c01d128805ad52e1182045e5
3
+ size 5929366
onnx/dit_q4_chunk_0.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:820a926d7fe530b57858e1f28514e4f73f4b8adace4ea86150af1474ba17e2c4
3
+ size 96468992
onnx/dit_q4_chunk_1.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aef2ba5b21b2b075aa4deddd220bdaf3ec62c5d5ec1e0442e289daab8cfc02d8
3
+ size 99614720
onnx/dit_q4_chunk_2.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b18d3acd769c1b071768a4da71f9ade71d75ad1ec49cb043ac899867525b06f
3
+ size 99614720
onnx/dit_q4_chunk_3.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4357e4c777f9f90d7e35e805471b7964e7f220716cab92a0c55d1c300f65c622
3
+ size 84451328
onnx/dit_q4_chunks.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "dit_q4.onnx",
3
+ "chunks": [
4
+ {
5
+ "name": "dit_q4_chunk_0.data",
6
+ "size": 96468992
7
+ },
8
+ {
9
+ "name": "dit_q4_chunk_1.data",
10
+ "size": 99614720
11
+ },
12
+ {
13
+ "name": "dit_q4_chunk_2.data",
14
+ "size": 99614720
15
+ },
16
+ {
17
+ "name": "dit_q4_chunk_3.data",
18
+ "size": 84451328
19
+ }
20
+ ],
21
+ "total_weight_mb": 380.15
22
+ }
onnx/shard_summary.json ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dit_q4": {
3
+ "model": "dit_q4.onnx",
4
+ "chunks": [
5
+ {
6
+ "name": "dit_q4_chunk_0.data",
7
+ "size": 96468992
8
+ },
9
+ {
10
+ "name": "dit_q4_chunk_1.data",
11
+ "size": 99614720
12
+ },
13
+ {
14
+ "name": "dit_q4_chunk_2.data",
15
+ "size": 99614720
16
+ },
17
+ {
18
+ "name": "dit_q4_chunk_3.data",
19
+ "size": 84451328
20
+ }
21
+ ],
22
+ "total_weight_mb": 380.15
23
+ },
24
+ "decoder_q4": {
25
+ "model": "decoder_q4.onnx",
26
+ "chunks": [
27
+ {
28
+ "name": "decoder_q4_chunk_0.data",
29
+ "size": 44894208
30
+ }
31
+ ],
32
+ "total_weight_mb": 44.89
33
+ },
34
+ "text_encoder_q4": {
35
+ "model": "text_encoder_q4.onnx",
36
+ "chunks": [
37
+ {
38
+ "name": "text_encoder_q4_chunk_0.data",
39
+ "size": 98304000
40
+ },
41
+ {
42
+ "name": "text_encoder_q4_chunk_1.data",
43
+ "size": 99418112
44
+ },
45
+ {
46
+ "name": "text_encoder_q4_chunk_2.data",
47
+ "size": 14811136
48
+ }
49
+ ],
50
+ "total_weight_mb": 212.53
51
+ }
52
+ }
onnx/text_encoder_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8677dd1e78cb0d587323c71228c3cb5cc5665ae859a5a016b3d4d35d9b4c2c00
3
+ size 2232988
onnx/text_encoder_q4_chunk_0.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0ba3442706d7c667737588bdde18f5ea93c586a7f2b9b5e93cb7aab66fb7a84
3
+ size 98304000
onnx/text_encoder_q4_chunk_1.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f625dbba3a64be52803dc1e0271a19b72c3faee9098d7f1c538f1d79ce44b048
3
+ size 99418112
onnx/text_encoder_q4_chunk_2.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c201c674073d2d50e0be25813634be7fd80f9d0665de383568e4297c99b482b1
3
+ size 14811136
onnx/text_encoder_q4_chunks.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "text_encoder_q4.onnx",
3
+ "chunks": [
4
+ {
5
+ "name": "text_encoder_q4_chunk_0.data",
6
+ "size": 98304000
7
+ },
8
+ {
9
+ "name": "text_encoder_q4_chunk_1.data",
10
+ "size": 99418112
11
+ },
12
+ {
13
+ "name": "text_encoder_q4_chunk_2.data",
14
+ "size": 14811136
15
+ }
16
+ ],
17
+ "total_weight_mb": 212.53
18
+ }
tokenizer/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:923de64f4705efd22f6880dc5e6a9b2993de2706a03d0d48773e0173e32a074f
3
+ size 34362428
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<bos>",
4
+ "clean_up_tokenization_spaces": false,
5
+ "eos_token": "<eos>",
6
+ "is_local": false,
7
+ "local_files_only": false,
8
+ "mask_token": "<mask>",
9
+ "model_max_length": 1000000000000000019884624838656,
10
+ "pad_token": "<pad>",
11
+ "padding_side": "right",
12
+ "sp_model_kwargs": {},
13
+ "spaces_between_special_tokens": false,
14
+ "tokenizer_class": "GemmaTokenizer",
15
+ "unk_token": "<unk>",
16
+ "use_default_system_prompt": false
17
+ }