Text-to-Image
Diffusers
Safetensors
English
remote-sensing
earth-observation
satellite-imagery
flow-matching
diffusion-transformer
geospatial
Instructions to use BiliSakura/GeoCore-9B-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BiliSakura/GeoCore-9B-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("BiliSakura/GeoCore-9B-diffusers", dtype=torch.bfloat16, device_map="cuda") prompt = "A parking lot full of cars is located next to some trees." image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Add files using upload-large-folder tool
Browse files- .gitattributes +3 -0
- LICENSE +179 -0
- LICENSE-FLUX2-VAE.md +176 -0
- README.md +118 -0
- demo/commercial.png +3 -0
- demo/parking.png +3 -0
- demo/roundabout.png +0 -0
- demo/tennis.png +3 -0
- model_index.json +35 -0
- pipeline.py +422 -0
- scheduler/scheduler_config.json +7 -0
- text_encoder/config.json +24 -0
- text_encoder/model.safetensors +3 -0
- text_encoder_2/config.json +31 -0
- text_encoder_2/model-00001-of-00002.safetensors +3 -0
- text_encoder_2/model-00002-of-00002.safetensors +3 -0
- text_encoder_2/model.safetensors.index.json +226 -0
- tokenizer/merges.txt +0 -0
- tokenizer/special_tokens_map.json +30 -0
- tokenizer/tokenizer_config.json +30 -0
- tokenizer/vocab.json +0 -0
- tokenizer_2/special_tokens_map.json +125 -0
- tokenizer_2/spiece.model +3 -0
- tokenizer_2/tokenizer.json +0 -0
- tokenizer_2/tokenizer_config.json +940 -0
- transformer/config.json +26 -0
- transformer/diffusion_pytorch_model-00001-of-00004.safetensors +3 -0
- transformer/diffusion_pytorch_model-00002-of-00004.safetensors +3 -0
- transformer/diffusion_pytorch_model-00003-of-00004.safetensors +3 -0
- transformer/diffusion_pytorch_model-00004-of-00004.safetensors +3 -0
- transformer/diffusion_pytorch_model.safetensors.index.json +221 -0
- transformer/transformer_geocore.py +767 -0
- vae/config.json +40 -0
- vae/diffusion_pytorch_model.safetensors +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ 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 |
+
demo/parking.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
demo/commercial.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
demo/tennis.png filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 108 |
+
must include a readable copy of the attribution notices
|
| 109 |
+
contained within such NOTICE file, excluding those notices
|
| 110 |
+
that do not pertain to any part of the Derivative Works.
|
| 111 |
+
|
| 112 |
+
You may add Your own copyright statement to Your modifications and
|
| 113 |
+
may provide additional or different license terms and conditions
|
| 114 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 115 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 116 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 117 |
+
the conditions stated in this License.
|
| 118 |
+
|
| 119 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 120 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 121 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 122 |
+
this License, without any additional terms or conditions.
|
| 123 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 124 |
+
the terms of any separate license agreement you may have executed
|
| 125 |
+
with Licensor regarding such Contributions.
|
| 126 |
+
|
| 127 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 128 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 129 |
+
except as required for reasonable and customary use in describing the
|
| 130 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 131 |
+
|
| 132 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 133 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 134 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 135 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 136 |
+
implied, including, without limitation, any warranties or conditions
|
| 137 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 138 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 139 |
+
appropriateness of using or redistributing the Work and assume any
|
| 140 |
+
risks associated with Your exercise of permissions under this License.
|
| 141 |
+
|
| 142 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 143 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 144 |
+
unless required by applicable law (such as deliberate and grossly
|
| 145 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 146 |
+
liable to You for damages, including any direct, indirect, special,
|
| 147 |
+
incidental, or consequential damages of any character arising as a
|
| 148 |
+
result of this License or out of the use or inability to use the
|
| 149 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 150 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 151 |
+
other commercial damages or losses), even if such Contributor
|
| 152 |
+
has been advised of the possibility of such damages.
|
| 153 |
+
|
| 154 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 155 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 156 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 157 |
+
or other liability obligations and/or rights consistent with this
|
| 158 |
+
License. However, in accepting such obligations, You may act only
|
| 159 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 160 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 161 |
+
defend, and hold each Contributor harmless for any liability
|
| 162 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 163 |
+
of your accepting any such warranty or additional liability.
|
| 164 |
+
|
| 165 |
+
END OF TERMS AND CONDITIONS
|
| 166 |
+
|
| 167 |
+
Copyright 2026 Jeonghyeok Do and Munchurl Kim
|
| 168 |
+
|
| 169 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 170 |
+
you may not use this file except in compliance with the License.
|
| 171 |
+
You may obtain a copy of the License at
|
| 172 |
+
|
| 173 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 174 |
+
|
| 175 |
+
Unless required by applicable law or agreed to in writing, software
|
| 176 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 177 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 178 |
+
See the License for the specific language governing permissions and
|
| 179 |
+
limitations under the License.
|
LICENSE-FLUX2-VAE.md
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
|
README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: diffusers
|
| 4 |
+
pipeline_tag: text-to-image
|
| 5 |
+
tags:
|
| 6 |
+
- diffusers
|
| 7 |
+
- remote-sensing
|
| 8 |
+
- earth-observation
|
| 9 |
+
- satellite-imagery
|
| 10 |
+
- text-to-image
|
| 11 |
+
- flow-matching
|
| 12 |
+
- diffusion-transformer
|
| 13 |
+
- geospatial
|
| 14 |
+
datasets:
|
| 15 |
+
- lcybuaa/Git-10M
|
| 16 |
+
inference: true
|
| 17 |
+
language:
|
| 18 |
+
- en
|
| 19 |
+
widget:
|
| 20 |
+
- text: A parking lot full of cars is located next to some trees.
|
| 21 |
+
output:
|
| 22 |
+
url: demo/parking.png
|
| 23 |
+
- text: Many buildings are located in a commercial area.
|
| 24 |
+
output:
|
| 25 |
+
url: demo/commercial.png
|
| 26 |
+
- text: A roundabout is surrounded by grass.
|
| 27 |
+
output:
|
| 28 |
+
url: demo/roundabout.png
|
| 29 |
+
- text: Two tennis courts are semi-surrounded by several green trees.
|
| 30 |
+
output:
|
| 31 |
+
url: demo/tennis.png
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
# BiliSakura/GeoCore-9B-diffusers
|
| 35 |
+
|
| 36 |
+
Self-contained [Diffusers](https://github.com/huggingface/diffusers) checkpoint for **GeoCore-9B**: 256×256 optical satellite generation from text, with optional GSD, latitude, and longitude.
|
| 37 |
+
|
| 38 |
+
Converted from [`JeonghyeokDo/GeoCore-9B`](https://huggingface.co/JeonghyeokDo/GeoCore-9B). `DiffusionPipeline.from_pretrained` loads the DiT, Flux.2 VAE, CLIP-L, T5-XXL, and `FlowMatchEulerDiscreteScheduler` from this repo (`trust_remote_code=True`).
|
| 39 |
+
|
| 40 |
+
[Project](https://kaist-viclab.github.io/GeoCore-9B_site/) ·
|
| 41 |
+
[Code](https://github.com/KAIST-VICLab/GeoCore-9B) ·
|
| 42 |
+
[Original weights](https://huggingface.co/JeonghyeokDo/GeoCore-9B)
|
| 43 |
+
|
| 44 |
+
<Gallery />
|
| 45 |
+
|
| 46 |
+
## Demo
|
| 47 |
+
|
| 48 |
+
256×256, 50 Euler steps, `guidance_scale=4.0`, seed `42`, `lon=126.97`, `lat=37.56`, `res=0.0` (Seoul).
|
| 49 |
+
|
| 50 |
+
| Parking lot | Commercial | Roundabout | Tennis courts |
|
| 51 |
+
| --- | --- | --- | --- |
|
| 52 |
+
|  |  |  |  |
|
| 53 |
+
|
| 54 |
+
## Model details
|
| 55 |
+
|
| 56 |
+
| Field | Value |
|
| 57 |
+
| --- | --- |
|
| 58 |
+
| Pipeline | `GeoCorePipeline` (`pipeline.py`) |
|
| 59 |
+
| Transformer | Flow-matching DiT, 8 double-stream + 24 single-stream blocks, hidden 4096, 32 heads, **9.24B** |
|
| 60 |
+
| Text encoders | CLIP ViT-L/14 + T5-XXL (bundled) |
|
| 61 |
+
| VAE | Flux.2 `AutoencoderKLFlux2` (Apache-2.0, bundled) |
|
| 62 |
+
| Scheduler | `FlowMatchEulerDiscreteScheduler`, `shift=1.0` |
|
| 63 |
+
| Resolution | 256×256 |
|
| 64 |
+
| Training data | [Git-10M](https://huggingface.co/datasets/lcybuaa/Git-10M) |
|
| 65 |
+
| License | Apache-2.0 |
|
| 66 |
+
|
| 67 |
+
## Load from Hugging Face
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
import torch
|
| 71 |
+
from diffusers import DiffusionPipeline
|
| 72 |
+
|
| 73 |
+
pipe = DiffusionPipeline.from_pretrained(
|
| 74 |
+
"BiliSakura/GeoCore-9B-diffusers",
|
| 75 |
+
trust_remote_code=True,
|
| 76 |
+
torch_dtype=torch.bfloat16,
|
| 77 |
+
).to("cuda")
|
| 78 |
+
|
| 79 |
+
image = pipe(
|
| 80 |
+
prompt="A parking lot full of cars is located next to some trees.",
|
| 81 |
+
lon=126.97,
|
| 82 |
+
lat=37.56,
|
| 83 |
+
res=0.0,
|
| 84 |
+
height=256,
|
| 85 |
+
width=256,
|
| 86 |
+
num_inference_steps=50,
|
| 87 |
+
guidance_scale=4.0,
|
| 88 |
+
generator=torch.Generator(device="cuda").manual_seed(42),
|
| 89 |
+
).images[0]
|
| 90 |
+
image.save("demo.png")
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
The DiT is ~18.5 GB in bf16. A 24 GB GPU is tight; on two GPUs, split only the transformer with Accelerate and keep CLIP, T5, and the VAE on one device.
|
| 94 |
+
|
| 95 |
+
## Conditioning
|
| 96 |
+
|
| 97 |
+
Captions follow the Git-10M style (short scene descriptions). Geospatial fields are optional.
|
| 98 |
+
|
| 99 |
+
| Argument | Meaning |
|
| 100 |
+
| --- | --- |
|
| 101 |
+
| `prompt` | Natural-language description |
|
| 102 |
+
| `res` | Resolution index `17 - z` for Google XYZ zoom `z`. `0` ≈ 1.2 m/px at the equator; each `+1` doubles GSD |
|
| 103 |
+
| `lon`, `lat` | Degrees |
|
| 104 |
+
| `-999.0` | Learned null embedding — any of `res` / `lon` / `lat` may be omitted |
|
| 105 |
+
|
| 106 |
+
## License
|
| 107 |
+
|
| 108 |
+
DiT weights © 2026 Jeonghyeok Do and Munchurl Kim, Apache-2.0. VAE is an unmodified Apache-2.0 Flux.2 autoencoder from [`black-forest-labs/FLUX.2-klein-base-4B`](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-4B); see [`LICENSE-FLUX2-VAE.md`](LICENSE-FLUX2-VAE.md). [Git-10M](https://huggingface.co/datasets/lcybuaa/Git-10M) is CC BY-NC-ND 4.0 (non-commercial retraining).
|
| 109 |
+
|
| 110 |
+
## Citation
|
| 111 |
+
|
| 112 |
+
```bibtex
|
| 113 |
+
@article{do2026geocore,
|
| 114 |
+
title = {GeoCore-9B: Towards Geo-Aware Generative Foundation Models in Earth Observation},
|
| 115 |
+
author = {Do, Jeonghyeok and Kim, Munchurl},
|
| 116 |
+
year = {2026}
|
| 117 |
+
}
|
| 118 |
+
```
|
demo/commercial.png
ADDED
|
Git LFS Details
|
demo/parking.png
ADDED
|
Git LFS Details
|
demo/roundabout.png
ADDED
|
demo/tennis.png
ADDED
|
Git LFS Details
|
model_index.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": [
|
| 3 |
+
"pipeline",
|
| 4 |
+
"GeoCorePipeline"
|
| 5 |
+
],
|
| 6 |
+
"_diffusers_version": "0.32.0",
|
| 7 |
+
"scheduler": [
|
| 8 |
+
"diffusers",
|
| 9 |
+
"FlowMatchEulerDiscreteScheduler"
|
| 10 |
+
],
|
| 11 |
+
"transformer": [
|
| 12 |
+
"transformer_geocore",
|
| 13 |
+
"GeoCoreTransformer2DModel"
|
| 14 |
+
],
|
| 15 |
+
"vae": [
|
| 16 |
+
"diffusers",
|
| 17 |
+
"AutoencoderKLFlux2"
|
| 18 |
+
],
|
| 19 |
+
"text_encoder": [
|
| 20 |
+
"transformers",
|
| 21 |
+
"CLIPTextModel"
|
| 22 |
+
],
|
| 23 |
+
"text_encoder_2": [
|
| 24 |
+
"transformers",
|
| 25 |
+
"T5EncoderModel"
|
| 26 |
+
],
|
| 27 |
+
"tokenizer": [
|
| 28 |
+
"transformers",
|
| 29 |
+
"CLIPTokenizer"
|
| 30 |
+
],
|
| 31 |
+
"tokenizer_2": [
|
| 32 |
+
"transformers",
|
| 33 |
+
"T5TokenizerFast"
|
| 34 |
+
]
|
| 35 |
+
}
|
pipeline.py
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2026 Jeonghyeok Do and Munchurl Kim. All rights reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
"""Diffusers custom pipeline for GeoCore text- and geo-conditioned EO image generation.
|
| 15 |
+
|
| 16 |
+
This file is Hub-copyable: `scripts/convert_checkpoint.py` copies it to the model
|
| 17 |
+
repository as `pipeline.py` so inference needs only Diffusers + the model repo.
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
from __future__ import annotations
|
| 21 |
+
|
| 22 |
+
from dataclasses import dataclass
|
| 23 |
+
from typing import Any
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
from diffusers import AutoencoderKLFlux2
|
| 27 |
+
from diffusers.image_processor import VaeImageProcessor
|
| 28 |
+
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
|
| 29 |
+
from diffusers.utils import BaseOutput, is_torch_xla_available, logging, replace_example_docstring
|
| 30 |
+
from diffusers.utils.torch_utils import randn_tensor
|
| 31 |
+
from PIL import Image
|
| 32 |
+
from transformers import CLIPTextModel, CLIPTokenizer, T5EncoderModel, T5TokenizerFast
|
| 33 |
+
|
| 34 |
+
if is_torch_xla_available():
|
| 35 |
+
import torch_xla.core.xla_model as xm
|
| 36 |
+
|
| 37 |
+
XLA_AVAILABLE = True
|
| 38 |
+
else:
|
| 39 |
+
XLA_AVAILABLE = False
|
| 40 |
+
|
| 41 |
+
logger = logging.get_logger(__name__)
|
| 42 |
+
|
| 43 |
+
NULL_META = -999.0
|
| 44 |
+
DEFAULT_CLIP_REPO = "openai/clip-vit-large-patch14"
|
| 45 |
+
DEFAULT_T5_REPO = "google/t5-v1_1-xxl"
|
| 46 |
+
TEXT_SEQ_LEN = 256
|
| 47 |
+
|
| 48 |
+
EXAMPLE_DOC_STRING = """
|
| 49 |
+
Examples:
|
| 50 |
+
```py
|
| 51 |
+
>>> from pathlib import Path
|
| 52 |
+
>>> import torch
|
| 53 |
+
>>> from diffusers import DiffusionPipeline
|
| 54 |
+
|
| 55 |
+
>>> model_dir = Path("/path/to/GeoCore-9B")
|
| 56 |
+
>>> pipe = DiffusionPipeline.from_pretrained(
|
| 57 |
+
... str(model_dir),
|
| 58 |
+
... custom_pipeline=str(model_dir / "pipeline.py"),
|
| 59 |
+
... trust_remote_code=True,
|
| 60 |
+
... torch_dtype=torch.bfloat16,
|
| 61 |
+
... ).to("cuda")
|
| 62 |
+
|
| 63 |
+
>>> image = pipe(
|
| 64 |
+
... prompt="A satellite view of a highly dense urban city with towering skyscrapers",
|
| 65 |
+
... lon=126.97,
|
| 66 |
+
... lat=37.56,
|
| 67 |
+
... res=0.0,
|
| 68 |
+
... num_inference_steps=50,
|
| 69 |
+
... guidance_scale=4.0,
|
| 70 |
+
... generator=torch.Generator("cuda").manual_seed(0),
|
| 71 |
+
... ).images[0]
|
| 72 |
+
```
|
| 73 |
+
"""
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
@dataclass
|
| 77 |
+
class GeoCorePipelineOutput(BaseOutput):
|
| 78 |
+
"""Output class for GeoCore pipelines."""
|
| 79 |
+
|
| 80 |
+
images: list[Image.Image] | None = None
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
class GeoCorePipeline(DiffusionPipeline):
|
| 84 |
+
r"""Text- and geospatial-metadata-conditioned sampling for GeoCore-9B."""
|
| 85 |
+
|
| 86 |
+
model_cpu_offload_seq = "text_encoder->text_encoder_2->transformer->vae"
|
| 87 |
+
_optional_components = ["text_encoder", "text_encoder_2", "tokenizer", "tokenizer_2"]
|
| 88 |
+
|
| 89 |
+
def __init__(
|
| 90 |
+
self,
|
| 91 |
+
transformer,
|
| 92 |
+
vae: AutoencoderKLFlux2,
|
| 93 |
+
scheduler,
|
| 94 |
+
text_encoder: CLIPTextModel | None = None,
|
| 95 |
+
text_encoder_2: T5EncoderModel | None = None,
|
| 96 |
+
tokenizer: CLIPTokenizer | None = None,
|
| 97 |
+
tokenizer_2: T5TokenizerFast | None = None,
|
| 98 |
+
) -> None:
|
| 99 |
+
super().__init__()
|
| 100 |
+
|
| 101 |
+
if text_encoder is None or tokenizer is None:
|
| 102 |
+
tokenizer = tokenizer or CLIPTokenizer.from_pretrained(DEFAULT_CLIP_REPO)
|
| 103 |
+
text_encoder = text_encoder or CLIPTextModel.from_pretrained(DEFAULT_CLIP_REPO)
|
| 104 |
+
if text_encoder_2 is None or tokenizer_2 is None:
|
| 105 |
+
tokenizer_2 = tokenizer_2 or T5TokenizerFast.from_pretrained(DEFAULT_T5_REPO)
|
| 106 |
+
text_encoder_2 = text_encoder_2 or T5EncoderModel.from_pretrained(DEFAULT_T5_REPO)
|
| 107 |
+
|
| 108 |
+
self.register_modules(
|
| 109 |
+
transformer=transformer,
|
| 110 |
+
vae=vae,
|
| 111 |
+
scheduler=scheduler,
|
| 112 |
+
text_encoder=text_encoder,
|
| 113 |
+
text_encoder_2=text_encoder_2,
|
| 114 |
+
tokenizer=tokenizer,
|
| 115 |
+
tokenizer_2=tokenizer_2,
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
|
| 119 |
+
# Flux.2 packs 2×2 latent patches, so the DiT sees resolution / 16.
|
| 120 |
+
self.vae_scale_factor_packing = self.vae_scale_factor * 2
|
| 121 |
+
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor_packing)
|
| 122 |
+
self._null_pooled: torch.Tensor | None = None
|
| 123 |
+
self._null_prompt: torch.Tensor | None = None
|
| 124 |
+
|
| 125 |
+
@property
|
| 126 |
+
def guidance_scale(self) -> float:
|
| 127 |
+
return self._guidance_scale
|
| 128 |
+
|
| 129 |
+
@property
|
| 130 |
+
def do_classifier_free_guidance(self) -> bool:
|
| 131 |
+
return self._guidance_scale > 1.0
|
| 132 |
+
|
| 133 |
+
def _cache_null_text_embeddings(self) -> None:
|
| 134 |
+
if self._null_prompt is not None and self._null_pooled is not None:
|
| 135 |
+
return
|
| 136 |
+
|
| 137 |
+
device = self._execution_device
|
| 138 |
+
dtype = self.text_encoder.dtype
|
| 139 |
+
clip_inputs = self.tokenizer(
|
| 140 |
+
[""], padding="max_length", max_length=77, truncation=True, return_tensors="pt",
|
| 141 |
+
).to(device)
|
| 142 |
+
self._null_pooled = self.text_encoder(clip_inputs.input_ids).pooler_output.to(dtype=dtype)
|
| 143 |
+
t5_inputs = self.tokenizer_2(
|
| 144 |
+
[""], padding="max_length", max_length=TEXT_SEQ_LEN, truncation=True, return_tensors="pt",
|
| 145 |
+
).to(device)
|
| 146 |
+
self._null_prompt = self.text_encoder_2(t5_inputs.input_ids)[0].to(dtype=dtype)
|
| 147 |
+
|
| 148 |
+
def check_inputs(
|
| 149 |
+
self,
|
| 150 |
+
prompt: str | list[str],
|
| 151 |
+
height: int,
|
| 152 |
+
width: int,
|
| 153 |
+
guidance_scale: float,
|
| 154 |
+
lon: float | list[float] | None,
|
| 155 |
+
lat: float | list[float] | None,
|
| 156 |
+
res: float | list[float] | None,
|
| 157 |
+
) -> None:
|
| 158 |
+
if height % 16 != 0 or width % 16 != 0:
|
| 159 |
+
raise ValueError(f"`height` and `width` must be divisible by 16, got {height}x{width}.")
|
| 160 |
+
if guidance_scale < 0:
|
| 161 |
+
raise ValueError(f"`guidance_scale` must be >= 0, got {guidance_scale}.")
|
| 162 |
+
if isinstance(prompt, list) and len(prompt) == 0:
|
| 163 |
+
raise ValueError("`prompt` must be a non-empty string or list of strings.")
|
| 164 |
+
|
| 165 |
+
@staticmethod
|
| 166 |
+
def _prepare_latent_image_ids(height: int, width: int, device: torch.device, dtype: torch.dtype) -> torch.Tensor:
|
| 167 |
+
latent_image_ids = torch.zeros(height, width, 3, device=device, dtype=dtype)
|
| 168 |
+
latent_image_ids[..., 1] = latent_image_ids[..., 1] + torch.arange(height, device=device, dtype=dtype)[:, None]
|
| 169 |
+
latent_image_ids[..., 2] = latent_image_ids[..., 2] + torch.arange(width, device=device, dtype=dtype)[None, :]
|
| 170 |
+
return latent_image_ids.reshape(height * width, 3)
|
| 171 |
+
|
| 172 |
+
def _encode_prompt(
|
| 173 |
+
self,
|
| 174 |
+
prompt: str | list[str],
|
| 175 |
+
device: torch.device,
|
| 176 |
+
dtype: torch.dtype,
|
| 177 |
+
num_images_per_prompt: int = 1,
|
| 178 |
+
) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 179 |
+
if isinstance(prompt, str):
|
| 180 |
+
prompt = [prompt]
|
| 181 |
+
|
| 182 |
+
batch_size = len(prompt)
|
| 183 |
+
prompt_embeds = torch.empty((batch_size, TEXT_SEQ_LEN, 4096), device=device, dtype=dtype)
|
| 184 |
+
pooled_embeds = torch.empty((batch_size, 768), device=device, dtype=dtype)
|
| 185 |
+
text_ids = torch.zeros((batch_size, TEXT_SEQ_LEN, 3), device=device, dtype=dtype)
|
| 186 |
+
text_ids[:, :, 0] = torch.arange(TEXT_SEQ_LEN, device=device, dtype=dtype)
|
| 187 |
+
|
| 188 |
+
self._cache_null_text_embeddings()
|
| 189 |
+
assert self._null_prompt is not None and self._null_pooled is not None
|
| 190 |
+
|
| 191 |
+
empty_indices = [index for index, text in enumerate(prompt) if text == ""]
|
| 192 |
+
valid_indices = [index for index, text in enumerate(prompt) if text != ""]
|
| 193 |
+
|
| 194 |
+
if empty_indices:
|
| 195 |
+
prompt_embeds[empty_indices] = self._null_prompt.expand(len(empty_indices), -1, -1)
|
| 196 |
+
pooled_embeds[empty_indices] = self._null_pooled.expand(len(empty_indices), -1)
|
| 197 |
+
|
| 198 |
+
if valid_indices:
|
| 199 |
+
valid_prompts = [prompt[index] for index in valid_indices]
|
| 200 |
+
clip_inputs = self.tokenizer(
|
| 201 |
+
valid_prompts, padding="max_length", max_length=77, truncation=True, return_tensors="pt",
|
| 202 |
+
).to(device)
|
| 203 |
+
pooled_embeds[valid_indices] = self.text_encoder(clip_inputs.input_ids).pooler_output
|
| 204 |
+
t5_inputs = self.tokenizer_2(
|
| 205 |
+
valid_prompts, padding="max_length", max_length=TEXT_SEQ_LEN, truncation=True, return_tensors="pt",
|
| 206 |
+
).to(device)
|
| 207 |
+
prompt_embeds[valid_indices] = self.text_encoder_2(t5_inputs.input_ids)[0]
|
| 208 |
+
|
| 209 |
+
if num_images_per_prompt > 1:
|
| 210 |
+
prompt_embeds = prompt_embeds.repeat_interleave(num_images_per_prompt, dim=0)
|
| 211 |
+
pooled_embeds = pooled_embeds.repeat_interleave(num_images_per_prompt, dim=0)
|
| 212 |
+
text_ids = text_ids.repeat_interleave(num_images_per_prompt, dim=0)
|
| 213 |
+
|
| 214 |
+
return prompt_embeds, pooled_embeds, text_ids
|
| 215 |
+
|
| 216 |
+
def _get_null_conditioning(self, batch_size: int, device: torch.device, dtype: torch.dtype) -> dict[str, torch.Tensor]:
|
| 217 |
+
self._cache_null_text_embeddings()
|
| 218 |
+
assert self._null_prompt is not None and self._null_pooled is not None
|
| 219 |
+
return {
|
| 220 |
+
"ctx": self._null_prompt.expand(batch_size, -1, -1).to(device=device, dtype=dtype),
|
| 221 |
+
"y": self._null_pooled.expand(batch_size, -1).to(device=device, dtype=dtype),
|
| 222 |
+
"res": torch.zeros(batch_size, device=device, dtype=dtype),
|
| 223 |
+
"lon": torch.zeros(batch_size, device=device, dtype=dtype),
|
| 224 |
+
"lat": torch.zeros(batch_size, device=device, dtype=dtype),
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
@staticmethod
|
| 228 |
+
def _expand_batch(
|
| 229 |
+
value: float | list[float] | None,
|
| 230 |
+
batch_size: int,
|
| 231 |
+
device: torch.device,
|
| 232 |
+
dtype: torch.dtype,
|
| 233 |
+
default: float = NULL_META,
|
| 234 |
+
) -> torch.Tensor:
|
| 235 |
+
if value is None:
|
| 236 |
+
return torch.full((batch_size,), default, device=device, dtype=dtype)
|
| 237 |
+
if isinstance(value, (int, float)):
|
| 238 |
+
return torch.full((batch_size,), float(value), device=device, dtype=dtype)
|
| 239 |
+
if len(value) == 1:
|
| 240 |
+
return torch.full((batch_size,), float(value[0]), device=device, dtype=dtype)
|
| 241 |
+
return torch.tensor(value, device=device, dtype=dtype)
|
| 242 |
+
|
| 243 |
+
def prepare_latents(
|
| 244 |
+
self,
|
| 245 |
+
batch_size: int,
|
| 246 |
+
num_channels: int,
|
| 247 |
+
height: int,
|
| 248 |
+
width: int,
|
| 249 |
+
dtype: torch.dtype,
|
| 250 |
+
device: torch.device,
|
| 251 |
+
generator: torch.Generator | list[torch.Generator] | None,
|
| 252 |
+
latents: torch.Tensor | None = None,
|
| 253 |
+
) -> torch.Tensor:
|
| 254 |
+
if latents is not None:
|
| 255 |
+
return latents.to(device=device, dtype=dtype)
|
| 256 |
+
packed_height = height // self.vae_scale_factor_packing
|
| 257 |
+
packed_width = width // self.vae_scale_factor_packing
|
| 258 |
+
shape = (batch_size, num_channels, packed_height, packed_width)
|
| 259 |
+
return randn_tensor(shape, generator=generator, device=device, dtype=dtype)
|
| 260 |
+
|
| 261 |
+
@staticmethod
|
| 262 |
+
def _unpatchify_latents(latents: torch.Tensor) -> torch.Tensor:
|
| 263 |
+
batch_size, num_channels, height, width = latents.shape
|
| 264 |
+
latents = latents.reshape(batch_size, num_channels // 4, 2, 2, height, width)
|
| 265 |
+
latents = latents.permute(0, 1, 4, 2, 5, 3)
|
| 266 |
+
return latents.reshape(batch_size, num_channels // 4, height * 2, width * 2)
|
| 267 |
+
|
| 268 |
+
def _unpack_latents_for_vae(self, latents: torch.Tensor) -> torch.Tensor:
|
| 269 |
+
"""Undo Flux.2 batch-norm + 2×2 packing so AutoencoderKLFlux2.decode sees 32-channel latents."""
|
| 270 |
+
mean = self.vae.bn.running_mean.view(1, -1, 1, 1).to(device=latents.device, dtype=latents.dtype)
|
| 271 |
+
std = torch.sqrt(
|
| 272 |
+
self.vae.bn.running_var.view(1, -1, 1, 1) + self.vae.config.batch_norm_eps
|
| 273 |
+
).to(device=latents.device, dtype=latents.dtype)
|
| 274 |
+
return self._unpatchify_latents(latents * std + mean)
|
| 275 |
+
|
| 276 |
+
def _predict_velocity(
|
| 277 |
+
self,
|
| 278 |
+
hidden_states: torch.Tensor,
|
| 279 |
+
timestep: torch.Tensor,
|
| 280 |
+
cond_kwargs: dict[str, torch.Tensor],
|
| 281 |
+
uncond_kwargs: dict[str, torch.Tensor],
|
| 282 |
+
guidance_scale: float,
|
| 283 |
+
guidance_low: float,
|
| 284 |
+
guidance_high: float,
|
| 285 |
+
) -> torch.Tensor:
|
| 286 |
+
t_value = float(timestep[0].item()) if timestep.ndim > 0 else float(timestep.item())
|
| 287 |
+
if guidance_scale > 1.0 and guidance_low <= t_value <= guidance_high:
|
| 288 |
+
model_input = torch.cat([hidden_states] * 2, dim=0)
|
| 289 |
+
t_input = torch.cat([timestep] * 2, dim=0)
|
| 290 |
+
combined_kwargs: dict[str, torch.Tensor] = {}
|
| 291 |
+
for key, value in cond_kwargs.items():
|
| 292 |
+
if key in ("ctx", "y", "res", "lon", "lat"):
|
| 293 |
+
uncond_value = uncond_kwargs.get(key, value)
|
| 294 |
+
combined_kwargs[key] = torch.cat([value, uncond_value], dim=0)
|
| 295 |
+
elif key in ("x_ids", "ctx_ids"):
|
| 296 |
+
if value.dim() == 3 and value.shape[0] == hidden_states.shape[0]:
|
| 297 |
+
combined_kwargs[key] = torch.cat([value] * 2, dim=0)
|
| 298 |
+
else:
|
| 299 |
+
combined_kwargs[key] = value
|
| 300 |
+
else:
|
| 301 |
+
combined_kwargs[key] = value
|
| 302 |
+
x_ids = combined_kwargs.pop("x_ids")
|
| 303 |
+
velocity = self.transformer(model_input, x_ids, t_input, **combined_kwargs)
|
| 304 |
+
if isinstance(velocity, tuple):
|
| 305 |
+
velocity = velocity[0]
|
| 306 |
+
velocity_cond, velocity_uncond = velocity.chunk(2)
|
| 307 |
+
return velocity_uncond + guidance_scale * (velocity_cond - velocity_uncond)
|
| 308 |
+
|
| 309 |
+
x_ids = cond_kwargs["x_ids"]
|
| 310 |
+
velocity = self.transformer(
|
| 311 |
+
hidden_states, x_ids, timestep, **{k: v for k, v in cond_kwargs.items() if k != "x_ids"},
|
| 312 |
+
)
|
| 313 |
+
if isinstance(velocity, tuple):
|
| 314 |
+
velocity = velocity[0]
|
| 315 |
+
return velocity
|
| 316 |
+
|
| 317 |
+
@replace_example_docstring(EXAMPLE_DOC_STRING)
|
| 318 |
+
@torch.no_grad()
|
| 319 |
+
def __call__(
|
| 320 |
+
self,
|
| 321 |
+
prompt: str | list[str],
|
| 322 |
+
height: int = 256,
|
| 323 |
+
width: int = 256,
|
| 324 |
+
num_inference_steps: int = 50,
|
| 325 |
+
guidance_scale: float = 4.0,
|
| 326 |
+
guidance_low: float = 0.0,
|
| 327 |
+
guidance_high: float = 1.0,
|
| 328 |
+
num_images_per_prompt: int = 1,
|
| 329 |
+
generator: torch.Generator | list[torch.Generator] | None = None,
|
| 330 |
+
latents: torch.Tensor | None = None,
|
| 331 |
+
output_type: str = "pil",
|
| 332 |
+
return_dict: bool = True,
|
| 333 |
+
lon: float | list[float] | None = None,
|
| 334 |
+
lat: float | list[float] | None = None,
|
| 335 |
+
res: float | list[float] | None = None,
|
| 336 |
+
callback_on_step_end: Any | None = None,
|
| 337 |
+
callback_on_step_end_tensor_inputs: list[str] | None = None,
|
| 338 |
+
) -> GeoCorePipelineOutput | tuple:
|
| 339 |
+
r"""
|
| 340 |
+
Generate Earth-observation images conditioned on text and geospatial metadata.
|
| 341 |
+
|
| 342 |
+
Examples:
|
| 343 |
+
"""
|
| 344 |
+
if isinstance(prompt, str):
|
| 345 |
+
prompt = [prompt]
|
| 346 |
+
|
| 347 |
+
self.check_inputs(prompt, height, width, guidance_scale, lon, lat, res)
|
| 348 |
+
self._guidance_scale = guidance_scale
|
| 349 |
+
|
| 350 |
+
device = self._execution_device
|
| 351 |
+
dtype = self.transformer.dtype
|
| 352 |
+
|
| 353 |
+
if lon is None or lat is None or (isinstance(lon, float) and lon == NULL_META) or (isinstance(lat, float) and lat == NULL_META):
|
| 354 |
+
lon = lat = NULL_META
|
| 355 |
+
elif isinstance(lon, list) or isinstance(lat, list):
|
| 356 |
+
lon_list = lon if isinstance(lon, list) else [lon] * len(prompt)
|
| 357 |
+
lat_list = lat if isinstance(lat, list) else [lat] * len(prompt)
|
| 358 |
+
lon = [NULL_META if l == NULL_META or la == NULL_META else l for l, la in zip(lon_list, lat_list)]
|
| 359 |
+
lat = [NULL_META if l == NULL_META or la == NULL_META else la for l, la in zip(lon_list, lat_list)]
|
| 360 |
+
|
| 361 |
+
batch_size = len(prompt) * num_images_per_prompt
|
| 362 |
+
latent_height = height // self.vae_scale_factor_packing
|
| 363 |
+
latent_width = width // self.vae_scale_factor_packing
|
| 364 |
+
latent_channels = getattr(self.transformer.config, "latent_channels", 128)
|
| 365 |
+
|
| 366 |
+
prompt_embeds, pooled_embeds, text_ids = self._encode_prompt(
|
| 367 |
+
prompt, device=device, dtype=dtype, num_images_per_prompt=num_images_per_prompt,
|
| 368 |
+
)
|
| 369 |
+
|
| 370 |
+
cond_kwargs = {
|
| 371 |
+
"ctx": prompt_embeds,
|
| 372 |
+
"ctx_ids": text_ids,
|
| 373 |
+
"y": pooled_embeds,
|
| 374 |
+
"res": self._expand_batch(res, batch_size, device, dtype),
|
| 375 |
+
"lon": self._expand_batch(lon, batch_size, device, dtype),
|
| 376 |
+
"lat": self._expand_batch(lat, batch_size, device, dtype),
|
| 377 |
+
"x_ids": self._prepare_latent_image_ids(latent_height, latent_width, device, dtype)
|
| 378 |
+
.unsqueeze(0)
|
| 379 |
+
.repeat(batch_size, 1, 1),
|
| 380 |
+
}
|
| 381 |
+
uncond_kwargs = self._get_null_conditioning(batch_size, device, dtype)
|
| 382 |
+
uncond_kwargs["ctx_ids"] = text_ids
|
| 383 |
+
|
| 384 |
+
self.scheduler.set_timesteps(num_inference_steps, device=device)
|
| 385 |
+
if hasattr(self.scheduler, "set_begin_index"):
|
| 386 |
+
self.scheduler.set_begin_index(0)
|
| 387 |
+
latents = self.prepare_latents(
|
| 388 |
+
batch_size, latent_channels, height, width, dtype, device, generator, latents,
|
| 389 |
+
)
|
| 390 |
+
|
| 391 |
+
num_train_timesteps = self.scheduler.config.num_train_timesteps
|
| 392 |
+
for step_index, t in enumerate(self.progress_bar(self.scheduler.timesteps)):
|
| 393 |
+
# FlowMatchEulerDiscreteScheduler.timesteps are in [0, num_train_timesteps];
|
| 394 |
+
# the DiT is trained on continuous t in [0, 1], same as Flux.
|
| 395 |
+
timestep = t.expand(latents.shape[0]).to(device=device, dtype=dtype) / num_train_timesteps
|
| 396 |
+
velocity = self._predict_velocity(
|
| 397 |
+
latents, timestep, cond_kwargs, uncond_kwargs, guidance_scale, guidance_low, guidance_high,
|
| 398 |
+
)
|
| 399 |
+
latents = self.scheduler.step(velocity, t, latents, return_dict=False)[0]
|
| 400 |
+
|
| 401 |
+
if callback_on_step_end is not None:
|
| 402 |
+
callback_kwargs = {"prompt": prompt, "latents": latents, "step_index": step_index}
|
| 403 |
+
callback_outputs = callback_on_step_end(self, step_index, timestep, callback_kwargs)
|
| 404 |
+
latents = callback_outputs.pop("latents", latents)
|
| 405 |
+
|
| 406 |
+
if XLA_AVAILABLE:
|
| 407 |
+
xm.mark_step()
|
| 408 |
+
|
| 409 |
+
if output_type == "latent":
|
| 410 |
+
if not return_dict:
|
| 411 |
+
return (latents,)
|
| 412 |
+
return GeoCorePipelineOutput(images=latents)
|
| 413 |
+
|
| 414 |
+
latents = self._unpack_latents_for_vae(latents)
|
| 415 |
+
image = self.vae.decode(latents, return_dict=False)[0]
|
| 416 |
+
image = self.image_processor.postprocess(image, output_type=output_type)
|
| 417 |
+
|
| 418 |
+
self.maybe_free_model_hooks()
|
| 419 |
+
|
| 420 |
+
if not return_dict:
|
| 421 |
+
return (image,)
|
| 422 |
+
return GeoCorePipelineOutput(images=image)
|
scheduler/scheduler_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "FlowMatchEulerDiscreteScheduler",
|
| 3 |
+
"_diffusers_version": "0.32.0",
|
| 4 |
+
"num_train_timesteps": 1000,
|
| 5 |
+
"shift": 1.0,
|
| 6 |
+
"use_dynamic_shifting": false
|
| 7 |
+
}
|
text_encoder/config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"CLIPTextModel"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 0,
|
| 7 |
+
"dropout": 0.0,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "quick_gelu",
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"initializer_factor": 1.0,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 3072,
|
| 14 |
+
"layer_norm_eps": 1e-05,
|
| 15 |
+
"max_position_embeddings": 77,
|
| 16 |
+
"model_type": "clip_text_model",
|
| 17 |
+
"num_attention_heads": 12,
|
| 18 |
+
"num_hidden_layers": 12,
|
| 19 |
+
"pad_token_id": 1,
|
| 20 |
+
"projection_dim": 768,
|
| 21 |
+
"torch_dtype": "float16",
|
| 22 |
+
"transformers_version": "4.41.2",
|
| 23 |
+
"vocab_size": 49408
|
| 24 |
+
}
|
text_encoder/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:befd6d103721287c60e07d3513b98e71daafe53d723d964b8e5ffacb1cad34ad
|
| 3 |
+
size 246144128
|
text_encoder_2/config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"T5EncoderModel"
|
| 4 |
+
],
|
| 5 |
+
"classifier_dropout": 0.0,
|
| 6 |
+
"d_ff": 10240,
|
| 7 |
+
"d_kv": 64,
|
| 8 |
+
"d_model": 4096,
|
| 9 |
+
"decoder_start_token_id": 0,
|
| 10 |
+
"dense_act_fn": "gelu_new",
|
| 11 |
+
"dropout_rate": 0.1,
|
| 12 |
+
"eos_token_id": 1,
|
| 13 |
+
"feed_forward_proj": "gated-gelu",
|
| 14 |
+
"initializer_factor": 1.0,
|
| 15 |
+
"is_encoder_decoder": true,
|
| 16 |
+
"is_gated_act": true,
|
| 17 |
+
"layer_norm_epsilon": 1e-06,
|
| 18 |
+
"model_type": "t5",
|
| 19 |
+
"num_decoder_layers": 24,
|
| 20 |
+
"num_heads": 64,
|
| 21 |
+
"num_layers": 24,
|
| 22 |
+
"output_past": true,
|
| 23 |
+
"pad_token_id": 0,
|
| 24 |
+
"relative_attention_max_distance": 128,
|
| 25 |
+
"relative_attention_num_buckets": 32,
|
| 26 |
+
"tie_word_embeddings": false,
|
| 27 |
+
"torch_dtype": "float16",
|
| 28 |
+
"transformers_version": "4.41.2",
|
| 29 |
+
"use_cache": true,
|
| 30 |
+
"vocab_size": 32128
|
| 31 |
+
}
|
text_encoder_2/model-00001-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f2751ceeb2a96edd693e539dc5d6bba0b8d3814f49a9b3798403a0cec4b2e3d
|
| 3 |
+
size 4994582104
|
text_encoder_2/model-00002-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f63154532130422309532ff56f11945fbea8266c958e3133e8e5aef85c6293c7
|
| 3 |
+
size 4530066248
|
text_encoder_2/model.safetensors.index.json
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
"encoder.block.0.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 8 |
+
"encoder.block.0.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 9 |
+
"encoder.block.0.layer.0.SelfAttention.relative_attention_bias.weight": "model-00001-of-00002.safetensors",
|
| 10 |
+
"encoder.block.0.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 11 |
+
"encoder.block.0.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 12 |
+
"encoder.block.0.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 13 |
+
"encoder.block.0.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 14 |
+
"encoder.block.0.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 15 |
+
"encoder.block.0.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 16 |
+
"encoder.block.1.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 17 |
+
"encoder.block.1.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 18 |
+
"encoder.block.1.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 19 |
+
"encoder.block.1.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 20 |
+
"encoder.block.1.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 21 |
+
"encoder.block.1.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 22 |
+
"encoder.block.1.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 23 |
+
"encoder.block.1.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 24 |
+
"encoder.block.1.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 25 |
+
"encoder.block.10.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 26 |
+
"encoder.block.10.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 27 |
+
"encoder.block.10.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 28 |
+
"encoder.block.10.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 29 |
+
"encoder.block.10.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 30 |
+
"encoder.block.10.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 31 |
+
"encoder.block.10.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 32 |
+
"encoder.block.10.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 33 |
+
"encoder.block.10.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 34 |
+
"encoder.block.11.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 35 |
+
"encoder.block.11.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 36 |
+
"encoder.block.11.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 37 |
+
"encoder.block.11.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 38 |
+
"encoder.block.11.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 39 |
+
"encoder.block.11.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 40 |
+
"encoder.block.11.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 41 |
+
"encoder.block.11.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 42 |
+
"encoder.block.11.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 43 |
+
"encoder.block.12.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 44 |
+
"encoder.block.12.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 45 |
+
"encoder.block.12.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 46 |
+
"encoder.block.12.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 47 |
+
"encoder.block.12.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 48 |
+
"encoder.block.12.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 49 |
+
"encoder.block.12.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 50 |
+
"encoder.block.12.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 51 |
+
"encoder.block.12.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 52 |
+
"encoder.block.13.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 53 |
+
"encoder.block.13.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 54 |
+
"encoder.block.13.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 55 |
+
"encoder.block.13.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 56 |
+
"encoder.block.13.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 57 |
+
"encoder.block.13.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 58 |
+
"encoder.block.13.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 59 |
+
"encoder.block.13.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 60 |
+
"encoder.block.13.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 61 |
+
"encoder.block.14.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 62 |
+
"encoder.block.14.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 63 |
+
"encoder.block.14.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 64 |
+
"encoder.block.14.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 65 |
+
"encoder.block.14.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 66 |
+
"encoder.block.14.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 67 |
+
"encoder.block.14.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 68 |
+
"encoder.block.14.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 69 |
+
"encoder.block.14.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 70 |
+
"encoder.block.15.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 71 |
+
"encoder.block.15.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 72 |
+
"encoder.block.15.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 73 |
+
"encoder.block.15.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 74 |
+
"encoder.block.15.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 75 |
+
"encoder.block.15.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 76 |
+
"encoder.block.15.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 77 |
+
"encoder.block.15.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 78 |
+
"encoder.block.15.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 79 |
+
"encoder.block.16.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 80 |
+
"encoder.block.16.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 81 |
+
"encoder.block.16.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 82 |
+
"encoder.block.16.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 83 |
+
"encoder.block.16.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 84 |
+
"encoder.block.16.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 85 |
+
"encoder.block.16.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 86 |
+
"encoder.block.16.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 87 |
+
"encoder.block.16.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 88 |
+
"encoder.block.17.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 89 |
+
"encoder.block.17.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 90 |
+
"encoder.block.17.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 91 |
+
"encoder.block.17.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 92 |
+
"encoder.block.17.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 93 |
+
"encoder.block.17.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 94 |
+
"encoder.block.17.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 95 |
+
"encoder.block.17.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 96 |
+
"encoder.block.17.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 97 |
+
"encoder.block.18.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 98 |
+
"encoder.block.18.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 99 |
+
"encoder.block.18.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 100 |
+
"encoder.block.18.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 101 |
+
"encoder.block.18.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 102 |
+
"encoder.block.18.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 103 |
+
"encoder.block.18.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 104 |
+
"encoder.block.18.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 105 |
+
"encoder.block.18.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 106 |
+
"encoder.block.19.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 107 |
+
"encoder.block.19.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 108 |
+
"encoder.block.19.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 109 |
+
"encoder.block.19.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 110 |
+
"encoder.block.19.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 111 |
+
"encoder.block.19.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 112 |
+
"encoder.block.19.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 113 |
+
"encoder.block.19.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 114 |
+
"encoder.block.19.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 115 |
+
"encoder.block.2.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 116 |
+
"encoder.block.2.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 117 |
+
"encoder.block.2.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 118 |
+
"encoder.block.2.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 119 |
+
"encoder.block.2.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 120 |
+
"encoder.block.2.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 121 |
+
"encoder.block.2.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 122 |
+
"encoder.block.2.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 123 |
+
"encoder.block.2.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 124 |
+
"encoder.block.20.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 125 |
+
"encoder.block.20.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 126 |
+
"encoder.block.20.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 127 |
+
"encoder.block.20.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 128 |
+
"encoder.block.20.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 129 |
+
"encoder.block.20.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 130 |
+
"encoder.block.20.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 131 |
+
"encoder.block.20.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 132 |
+
"encoder.block.20.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 133 |
+
"encoder.block.21.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 134 |
+
"encoder.block.21.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 135 |
+
"encoder.block.21.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 136 |
+
"encoder.block.21.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 137 |
+
"encoder.block.21.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 138 |
+
"encoder.block.21.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 139 |
+
"encoder.block.21.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 140 |
+
"encoder.block.21.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 141 |
+
"encoder.block.21.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 142 |
+
"encoder.block.22.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 143 |
+
"encoder.block.22.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 144 |
+
"encoder.block.22.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 145 |
+
"encoder.block.22.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 146 |
+
"encoder.block.22.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 147 |
+
"encoder.block.22.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 148 |
+
"encoder.block.22.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 149 |
+
"encoder.block.22.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 150 |
+
"encoder.block.22.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 151 |
+
"encoder.block.23.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
|
| 152 |
+
"encoder.block.23.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
|
| 153 |
+
"encoder.block.23.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
|
| 154 |
+
"encoder.block.23.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
|
| 155 |
+
"encoder.block.23.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 156 |
+
"encoder.block.23.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
|
| 157 |
+
"encoder.block.23.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
|
| 158 |
+
"encoder.block.23.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
|
| 159 |
+
"encoder.block.23.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 160 |
+
"encoder.block.3.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 161 |
+
"encoder.block.3.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 162 |
+
"encoder.block.3.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 163 |
+
"encoder.block.3.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 164 |
+
"encoder.block.3.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 165 |
+
"encoder.block.3.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 166 |
+
"encoder.block.3.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 167 |
+
"encoder.block.3.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 168 |
+
"encoder.block.3.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 169 |
+
"encoder.block.4.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 170 |
+
"encoder.block.4.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 171 |
+
"encoder.block.4.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 172 |
+
"encoder.block.4.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 173 |
+
"encoder.block.4.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 174 |
+
"encoder.block.4.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 175 |
+
"encoder.block.4.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 176 |
+
"encoder.block.4.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 177 |
+
"encoder.block.4.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 178 |
+
"encoder.block.5.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 179 |
+
"encoder.block.5.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 180 |
+
"encoder.block.5.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 181 |
+
"encoder.block.5.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 182 |
+
"encoder.block.5.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 183 |
+
"encoder.block.5.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 184 |
+
"encoder.block.5.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 185 |
+
"encoder.block.5.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 186 |
+
"encoder.block.5.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 187 |
+
"encoder.block.6.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 188 |
+
"encoder.block.6.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 189 |
+
"encoder.block.6.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 190 |
+
"encoder.block.6.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 191 |
+
"encoder.block.6.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 192 |
+
"encoder.block.6.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 193 |
+
"encoder.block.6.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 194 |
+
"encoder.block.6.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 195 |
+
"encoder.block.6.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 196 |
+
"encoder.block.7.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 197 |
+
"encoder.block.7.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 198 |
+
"encoder.block.7.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 199 |
+
"encoder.block.7.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 200 |
+
"encoder.block.7.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 201 |
+
"encoder.block.7.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 202 |
+
"encoder.block.7.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 203 |
+
"encoder.block.7.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 204 |
+
"encoder.block.7.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 205 |
+
"encoder.block.8.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 206 |
+
"encoder.block.8.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 207 |
+
"encoder.block.8.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 208 |
+
"encoder.block.8.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 209 |
+
"encoder.block.8.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 210 |
+
"encoder.block.8.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 211 |
+
"encoder.block.8.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 212 |
+
"encoder.block.8.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 213 |
+
"encoder.block.8.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 214 |
+
"encoder.block.9.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
|
| 215 |
+
"encoder.block.9.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
|
| 216 |
+
"encoder.block.9.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
|
| 217 |
+
"encoder.block.9.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
|
| 218 |
+
"encoder.block.9.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 219 |
+
"encoder.block.9.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
|
| 220 |
+
"encoder.block.9.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
|
| 221 |
+
"encoder.block.9.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
|
| 222 |
+
"encoder.block.9.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
|
| 223 |
+
"encoder.final_layer_norm.weight": "model-00002-of-00002.safetensors",
|
| 224 |
+
"shared.weight": "model-00001-of-00002.safetensors"
|
| 225 |
+
}
|
| 226 |
+
}
|
tokenizer/merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer/special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<|startoftext|>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": true,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<|endoftext|>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<|endoftext|>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"unk_token": {
|
| 24 |
+
"content": "<|endoftext|>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
tokenizer/tokenizer_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"49406": {
|
| 5 |
+
"content": "<|startoftext|>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": true,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"49407": {
|
| 13 |
+
"content": "<|endoftext|>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
}
|
| 20 |
+
},
|
| 21 |
+
"bos_token": "<|startoftext|>",
|
| 22 |
+
"clean_up_tokenization_spaces": true,
|
| 23 |
+
"do_lower_case": true,
|
| 24 |
+
"eos_token": "<|endoftext|>",
|
| 25 |
+
"errors": "replace",
|
| 26 |
+
"model_max_length": 77,
|
| 27 |
+
"pad_token": "<|endoftext|>",
|
| 28 |
+
"tokenizer_class": "CLIPTokenizer",
|
| 29 |
+
"unk_token": "<|endoftext|>"
|
| 30 |
+
}
|
tokenizer/vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tok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|
+
"<extra_id_9>",
|
| 13 |
+
"<extra_id_10>",
|
| 14 |
+
"<extra_id_11>",
|
| 15 |
+
"<extra_id_12>",
|
| 16 |
+
"<extra_id_13>",
|
| 17 |
+
"<extra_id_14>",
|
| 18 |
+
"<extra_id_15>",
|
| 19 |
+
"<extra_id_16>",
|
| 20 |
+
"<extra_id_17>",
|
| 21 |
+
"<extra_id_18>",
|
| 22 |
+
"<extra_id_19>",
|
| 23 |
+
"<extra_id_20>",
|
| 24 |
+
"<extra_id_21>",
|
| 25 |
+
"<extra_id_22>",
|
| 26 |
+
"<extra_id_23>",
|
| 27 |
+
"<extra_id_24>",
|
| 28 |
+
"<extra_id_25>",
|
| 29 |
+
"<extra_id_26>",
|
| 30 |
+
"<extra_id_27>",
|
| 31 |
+
"<extra_id_28>",
|
| 32 |
+
"<extra_id_29>",
|
| 33 |
+
"<extra_id_30>",
|
| 34 |
+
"<extra_id_31>",
|
| 35 |
+
"<extra_id_32>",
|
| 36 |
+
"<extra_id_33>",
|
| 37 |
+
"<extra_id_34>",
|
| 38 |
+
"<extra_id_35>",
|
| 39 |
+
"<extra_id_36>",
|
| 40 |
+
"<extra_id_37>",
|
| 41 |
+
"<extra_id_38>",
|
| 42 |
+
"<extra_id_39>",
|
| 43 |
+
"<extra_id_40>",
|
| 44 |
+
"<extra_id_41>",
|
| 45 |
+
"<extra_id_42>",
|
| 46 |
+
"<extra_id_43>",
|
| 47 |
+
"<extra_id_44>",
|
| 48 |
+
"<extra_id_45>",
|
| 49 |
+
"<extra_id_46>",
|
| 50 |
+
"<extra_id_47>",
|
| 51 |
+
"<extra_id_48>",
|
| 52 |
+
"<extra_id_49>",
|
| 53 |
+
"<extra_id_50>",
|
| 54 |
+
"<extra_id_51>",
|
| 55 |
+
"<extra_id_52>",
|
| 56 |
+
"<extra_id_53>",
|
| 57 |
+
"<extra_id_54>",
|
| 58 |
+
"<extra_id_55>",
|
| 59 |
+
"<extra_id_56>",
|
| 60 |
+
"<extra_id_57>",
|
| 61 |
+
"<extra_id_58>",
|
| 62 |
+
"<extra_id_59>",
|
| 63 |
+
"<extra_id_60>",
|
| 64 |
+
"<extra_id_61>",
|
| 65 |
+
"<extra_id_62>",
|
| 66 |
+
"<extra_id_63>",
|
| 67 |
+
"<extra_id_64>",
|
| 68 |
+
"<extra_id_65>",
|
| 69 |
+
"<extra_id_66>",
|
| 70 |
+
"<extra_id_67>",
|
| 71 |
+
"<extra_id_68>",
|
| 72 |
+
"<extra_id_69>",
|
| 73 |
+
"<extra_id_70>",
|
| 74 |
+
"<extra_id_71>",
|
| 75 |
+
"<extra_id_72>",
|
| 76 |
+
"<extra_id_73>",
|
| 77 |
+
"<extra_id_74>",
|
| 78 |
+
"<extra_id_75>",
|
| 79 |
+
"<extra_id_76>",
|
| 80 |
+
"<extra_id_77>",
|
| 81 |
+
"<extra_id_78>",
|
| 82 |
+
"<extra_id_79>",
|
| 83 |
+
"<extra_id_80>",
|
| 84 |
+
"<extra_id_81>",
|
| 85 |
+
"<extra_id_82>",
|
| 86 |
+
"<extra_id_83>",
|
| 87 |
+
"<extra_id_84>",
|
| 88 |
+
"<extra_id_85>",
|
| 89 |
+
"<extra_id_86>",
|
| 90 |
+
"<extra_id_87>",
|
| 91 |
+
"<extra_id_88>",
|
| 92 |
+
"<extra_id_89>",
|
| 93 |
+
"<extra_id_90>",
|
| 94 |
+
"<extra_id_91>",
|
| 95 |
+
"<extra_id_92>",
|
| 96 |
+
"<extra_id_93>",
|
| 97 |
+
"<extra_id_94>",
|
| 98 |
+
"<extra_id_95>",
|
| 99 |
+
"<extra_id_96>",
|
| 100 |
+
"<extra_id_97>",
|
| 101 |
+
"<extra_id_98>",
|
| 102 |
+
"<extra_id_99>"
|
| 103 |
+
],
|
| 104 |
+
"eos_token": {
|
| 105 |
+
"content": "</s>",
|
| 106 |
+
"lstrip": false,
|
| 107 |
+
"normalized": false,
|
| 108 |
+
"rstrip": false,
|
| 109 |
+
"single_word": false
|
| 110 |
+
},
|
| 111 |
+
"pad_token": {
|
| 112 |
+
"content": "<pad>",
|
| 113 |
+
"lstrip": false,
|
| 114 |
+
"normalized": false,
|
| 115 |
+
"rstrip": false,
|
| 116 |
+
"single_word": false
|
| 117 |
+
},
|
| 118 |
+
"unk_token": {
|
| 119 |
+
"content": "<unk>",
|
| 120 |
+
"lstrip": false,
|
| 121 |
+
"normalized": false,
|
| 122 |
+
"rstrip": false,
|
| 123 |
+
"single_word": false
|
| 124 |
+
}
|
| 125 |
+
}
|
tokenizer_2/spiece.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d60acb128cf7b7f2536e8f38a5b18a05535c9e14c7a355904270e15b0945ea86
|
| 3 |
+
size 791656
|
tokenizer_2/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_2/tokenizer_config.json
ADDED
|
@@ -0,0 +1,940 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": true,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"0": {
|
| 5 |
+
"content": "<pad>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": false,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"1": {
|
| 13 |
+
"content": "</s>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
},
|
| 20 |
+
"2": {
|
| 21 |
+
"content": "<unk>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": false,
|
| 24 |
+
"rstrip": false,
|
| 25 |
+
"single_word": false,
|
| 26 |
+
"special": true
|
| 27 |
+
},
|
| 28 |
+
"32000": {
|
| 29 |
+
"content": "<extra_id_99>",
|
| 30 |
+
"lstrip": true,
|
| 31 |
+
"normalized": false,
|
| 32 |
+
"rstrip": true,
|
| 33 |
+
"single_word": false,
|
| 34 |
+
"special": true
|
| 35 |
+
},
|
| 36 |
+
"32001": {
|
| 37 |
+
"content": "<extra_id_98>",
|
| 38 |
+
"lstrip": true,
|
| 39 |
+
"normalized": false,
|
| 40 |
+
"rstrip": true,
|
| 41 |
+
"single_word": false,
|
| 42 |
+
"special": true
|
| 43 |
+
},
|
| 44 |
+
"32002": {
|
| 45 |
+
"content": "<extra_id_97>",
|
| 46 |
+
"lstrip": true,
|
| 47 |
+
"normalized": false,
|
| 48 |
+
"rstrip": true,
|
| 49 |
+
"single_word": false,
|
| 50 |
+
"special": true
|
| 51 |
+
},
|
| 52 |
+
"32003": {
|
| 53 |
+
"content": "<extra_id_96>",
|
| 54 |
+
"lstrip": true,
|
| 55 |
+
"normalized": false,
|
| 56 |
+
"rstrip": true,
|
| 57 |
+
"single_word": false,
|
| 58 |
+
"special": true
|
| 59 |
+
},
|
| 60 |
+
"32004": {
|
| 61 |
+
"content": "<extra_id_95>",
|
| 62 |
+
"lstrip": true,
|
| 63 |
+
"normalized": false,
|
| 64 |
+
"rstrip": true,
|
| 65 |
+
"single_word": false,
|
| 66 |
+
"special": true
|
| 67 |
+
},
|
| 68 |
+
"32005": {
|
| 69 |
+
"content": "<extra_id_94>",
|
| 70 |
+
"lstrip": true,
|
| 71 |
+
"normalized": false,
|
| 72 |
+
"rstrip": true,
|
| 73 |
+
"single_word": false,
|
| 74 |
+
"special": true
|
| 75 |
+
},
|
| 76 |
+
"32006": {
|
| 77 |
+
"content": "<extra_id_93>",
|
| 78 |
+
"lstrip": true,
|
| 79 |
+
"normalized": false,
|
| 80 |
+
"rstrip": true,
|
| 81 |
+
"single_word": false,
|
| 82 |
+
"special": true
|
| 83 |
+
},
|
| 84 |
+
"32007": {
|
| 85 |
+
"content": "<extra_id_92>",
|
| 86 |
+
"lstrip": true,
|
| 87 |
+
"normalized": false,
|
| 88 |
+
"rstrip": true,
|
| 89 |
+
"single_word": false,
|
| 90 |
+
"special": true
|
| 91 |
+
},
|
| 92 |
+
"32008": {
|
| 93 |
+
"content": "<extra_id_91>",
|
| 94 |
+
"lstrip": true,
|
| 95 |
+
"normalized": false,
|
| 96 |
+
"rstrip": true,
|
| 97 |
+
"single_word": false,
|
| 98 |
+
"special": true
|
| 99 |
+
},
|
| 100 |
+
"32009": {
|
| 101 |
+
"content": "<extra_id_90>",
|
| 102 |
+
"lstrip": true,
|
| 103 |
+
"normalized": false,
|
| 104 |
+
"rstrip": true,
|
| 105 |
+
"single_word": false,
|
| 106 |
+
"special": true
|
| 107 |
+
},
|
| 108 |
+
"32010": {
|
| 109 |
+
"content": "<extra_id_89>",
|
| 110 |
+
"lstrip": true,
|
| 111 |
+
"normalized": false,
|
| 112 |
+
"rstrip": true,
|
| 113 |
+
"single_word": false,
|
| 114 |
+
"special": true
|
| 115 |
+
},
|
| 116 |
+
"32011": {
|
| 117 |
+
"content": "<extra_id_88>",
|
| 118 |
+
"lstrip": true,
|
| 119 |
+
"normalized": false,
|
| 120 |
+
"rstrip": true,
|
| 121 |
+
"single_word": false,
|
| 122 |
+
"special": true
|
| 123 |
+
},
|
| 124 |
+
"32012": {
|
| 125 |
+
"content": "<extra_id_87>",
|
| 126 |
+
"lstrip": true,
|
| 127 |
+
"normalized": false,
|
| 128 |
+
"rstrip": true,
|
| 129 |
+
"single_word": false,
|
| 130 |
+
"special": true
|
| 131 |
+
},
|
| 132 |
+
"32013": {
|
| 133 |
+
"content": "<extra_id_86>",
|
| 134 |
+
"lstrip": true,
|
| 135 |
+
"normalized": false,
|
| 136 |
+
"rstrip": true,
|
| 137 |
+
"single_word": false,
|
| 138 |
+
"special": true
|
| 139 |
+
},
|
| 140 |
+
"32014": {
|
| 141 |
+
"content": "<extra_id_85>",
|
| 142 |
+
"lstrip": true,
|
| 143 |
+
"normalized": false,
|
| 144 |
+
"rstrip": true,
|
| 145 |
+
"single_word": false,
|
| 146 |
+
"special": true
|
| 147 |
+
},
|
| 148 |
+
"32015": {
|
| 149 |
+
"content": "<extra_id_84>",
|
| 150 |
+
"lstrip": true,
|
| 151 |
+
"normalized": false,
|
| 152 |
+
"rstrip": true,
|
| 153 |
+
"single_word": false,
|
| 154 |
+
"special": true
|
| 155 |
+
},
|
| 156 |
+
"32016": {
|
| 157 |
+
"content": "<extra_id_83>",
|
| 158 |
+
"lstrip": true,
|
| 159 |
+
"normalized": false,
|
| 160 |
+
"rstrip": true,
|
| 161 |
+
"single_word": false,
|
| 162 |
+
"special": true
|
| 163 |
+
},
|
| 164 |
+
"32017": {
|
| 165 |
+
"content": "<extra_id_82>",
|
| 166 |
+
"lstrip": true,
|
| 167 |
+
"normalized": false,
|
| 168 |
+
"rstrip": true,
|
| 169 |
+
"single_word": false,
|
| 170 |
+
"special": true
|
| 171 |
+
},
|
| 172 |
+
"32018": {
|
| 173 |
+
"content": "<extra_id_81>",
|
| 174 |
+
"lstrip": true,
|
| 175 |
+
"normalized": false,
|
| 176 |
+
"rstrip": true,
|
| 177 |
+
"single_word": false,
|
| 178 |
+
"special": true
|
| 179 |
+
},
|
| 180 |
+
"32019": {
|
| 181 |
+
"content": "<extra_id_80>",
|
| 182 |
+
"lstrip": true,
|
| 183 |
+
"normalized": false,
|
| 184 |
+
"rstrip": true,
|
| 185 |
+
"single_word": false,
|
| 186 |
+
"special": true
|
| 187 |
+
},
|
| 188 |
+
"32020": {
|
| 189 |
+
"content": "<extra_id_79>",
|
| 190 |
+
"lstrip": true,
|
| 191 |
+
"normalized": false,
|
| 192 |
+
"rstrip": true,
|
| 193 |
+
"single_word": false,
|
| 194 |
+
"special": true
|
| 195 |
+
},
|
| 196 |
+
"32021": {
|
| 197 |
+
"content": "<extra_id_78>",
|
| 198 |
+
"lstrip": true,
|
| 199 |
+
"normalized": false,
|
| 200 |
+
"rstrip": true,
|
| 201 |
+
"single_word": false,
|
| 202 |
+
"special": true
|
| 203 |
+
},
|
| 204 |
+
"32022": {
|
| 205 |
+
"content": "<extra_id_77>",
|
| 206 |
+
"lstrip": true,
|
| 207 |
+
"normalized": false,
|
| 208 |
+
"rstrip": true,
|
| 209 |
+
"single_word": false,
|
| 210 |
+
"special": true
|
| 211 |
+
},
|
| 212 |
+
"32023": {
|
| 213 |
+
"content": "<extra_id_76>",
|
| 214 |
+
"lstrip": true,
|
| 215 |
+
"normalized": false,
|
| 216 |
+
"rstrip": true,
|
| 217 |
+
"single_word": false,
|
| 218 |
+
"special": true
|
| 219 |
+
},
|
| 220 |
+
"32024": {
|
| 221 |
+
"content": "<extra_id_75>",
|
| 222 |
+
"lstrip": true,
|
| 223 |
+
"normalized": false,
|
| 224 |
+
"rstrip": true,
|
| 225 |
+
"single_word": false,
|
| 226 |
+
"special": true
|
| 227 |
+
},
|
| 228 |
+
"32025": {
|
| 229 |
+
"content": "<extra_id_74>",
|
| 230 |
+
"lstrip": true,
|
| 231 |
+
"normalized": false,
|
| 232 |
+
"rstrip": true,
|
| 233 |
+
"single_word": false,
|
| 234 |
+
"special": true
|
| 235 |
+
},
|
| 236 |
+
"32026": {
|
| 237 |
+
"content": "<extra_id_73>",
|
| 238 |
+
"lstrip": true,
|
| 239 |
+
"normalized": false,
|
| 240 |
+
"rstrip": true,
|
| 241 |
+
"single_word": false,
|
| 242 |
+
"special": true
|
| 243 |
+
},
|
| 244 |
+
"32027": {
|
| 245 |
+
"content": "<extra_id_72>",
|
| 246 |
+
"lstrip": true,
|
| 247 |
+
"normalized": false,
|
| 248 |
+
"rstrip": true,
|
| 249 |
+
"single_word": false,
|
| 250 |
+
"special": true
|
| 251 |
+
},
|
| 252 |
+
"32028": {
|
| 253 |
+
"content": "<extra_id_71>",
|
| 254 |
+
"lstrip": true,
|
| 255 |
+
"normalized": false,
|
| 256 |
+
"rstrip": true,
|
| 257 |
+
"single_word": false,
|
| 258 |
+
"special": true
|
| 259 |
+
},
|
| 260 |
+
"32029": {
|
| 261 |
+
"content": "<extra_id_70>",
|
| 262 |
+
"lstrip": true,
|
| 263 |
+
"normalized": false,
|
| 264 |
+
"rstrip": true,
|
| 265 |
+
"single_word": false,
|
| 266 |
+
"special": true
|
| 267 |
+
},
|
| 268 |
+
"32030": {
|
| 269 |
+
"content": "<extra_id_69>",
|
| 270 |
+
"lstrip": true,
|
| 271 |
+
"normalized": false,
|
| 272 |
+
"rstrip": true,
|
| 273 |
+
"single_word": false,
|
| 274 |
+
"special": true
|
| 275 |
+
},
|
| 276 |
+
"32031": {
|
| 277 |
+
"content": "<extra_id_68>",
|
| 278 |
+
"lstrip": true,
|
| 279 |
+
"normalized": false,
|
| 280 |
+
"rstrip": true,
|
| 281 |
+
"single_word": false,
|
| 282 |
+
"special": true
|
| 283 |
+
},
|
| 284 |
+
"32032": {
|
| 285 |
+
"content": "<extra_id_67>",
|
| 286 |
+
"lstrip": true,
|
| 287 |
+
"normalized": false,
|
| 288 |
+
"rstrip": true,
|
| 289 |
+
"single_word": false,
|
| 290 |
+
"special": true
|
| 291 |
+
},
|
| 292 |
+
"32033": {
|
| 293 |
+
"content": "<extra_id_66>",
|
| 294 |
+
"lstrip": true,
|
| 295 |
+
"normalized": false,
|
| 296 |
+
"rstrip": true,
|
| 297 |
+
"single_word": false,
|
| 298 |
+
"special": true
|
| 299 |
+
},
|
| 300 |
+
"32034": {
|
| 301 |
+
"content": "<extra_id_65>",
|
| 302 |
+
"lstrip": true,
|
| 303 |
+
"normalized": false,
|
| 304 |
+
"rstrip": true,
|
| 305 |
+
"single_word": false,
|
| 306 |
+
"special": true
|
| 307 |
+
},
|
| 308 |
+
"32035": {
|
| 309 |
+
"content": "<extra_id_64>",
|
| 310 |
+
"lstrip": true,
|
| 311 |
+
"normalized": false,
|
| 312 |
+
"rstrip": true,
|
| 313 |
+
"single_word": false,
|
| 314 |
+
"special": true
|
| 315 |
+
},
|
| 316 |
+
"32036": {
|
| 317 |
+
"content": "<extra_id_63>",
|
| 318 |
+
"lstrip": true,
|
| 319 |
+
"normalized": false,
|
| 320 |
+
"rstrip": true,
|
| 321 |
+
"single_word": false,
|
| 322 |
+
"special": true
|
| 323 |
+
},
|
| 324 |
+
"32037": {
|
| 325 |
+
"content": "<extra_id_62>",
|
| 326 |
+
"lstrip": true,
|
| 327 |
+
"normalized": false,
|
| 328 |
+
"rstrip": true,
|
| 329 |
+
"single_word": false,
|
| 330 |
+
"special": true
|
| 331 |
+
},
|
| 332 |
+
"32038": {
|
| 333 |
+
"content": "<extra_id_61>",
|
| 334 |
+
"lstrip": true,
|
| 335 |
+
"normalized": false,
|
| 336 |
+
"rstrip": true,
|
| 337 |
+
"single_word": false,
|
| 338 |
+
"special": true
|
| 339 |
+
},
|
| 340 |
+
"32039": {
|
| 341 |
+
"content": "<extra_id_60>",
|
| 342 |
+
"lstrip": true,
|
| 343 |
+
"normalized": false,
|
| 344 |
+
"rstrip": true,
|
| 345 |
+
"single_word": false,
|
| 346 |
+
"special": true
|
| 347 |
+
},
|
| 348 |
+
"32040": {
|
| 349 |
+
"content": "<extra_id_59>",
|
| 350 |
+
"lstrip": true,
|
| 351 |
+
"normalized": false,
|
| 352 |
+
"rstrip": true,
|
| 353 |
+
"single_word": false,
|
| 354 |
+
"special": true
|
| 355 |
+
},
|
| 356 |
+
"32041": {
|
| 357 |
+
"content": "<extra_id_58>",
|
| 358 |
+
"lstrip": true,
|
| 359 |
+
"normalized": false,
|
| 360 |
+
"rstrip": true,
|
| 361 |
+
"single_word": false,
|
| 362 |
+
"special": true
|
| 363 |
+
},
|
| 364 |
+
"32042": {
|
| 365 |
+
"content": "<extra_id_57>",
|
| 366 |
+
"lstrip": true,
|
| 367 |
+
"normalized": false,
|
| 368 |
+
"rstrip": true,
|
| 369 |
+
"single_word": false,
|
| 370 |
+
"special": true
|
| 371 |
+
},
|
| 372 |
+
"32043": {
|
| 373 |
+
"content": "<extra_id_56>",
|
| 374 |
+
"lstrip": true,
|
| 375 |
+
"normalized": false,
|
| 376 |
+
"rstrip": true,
|
| 377 |
+
"single_word": false,
|
| 378 |
+
"special": true
|
| 379 |
+
},
|
| 380 |
+
"32044": {
|
| 381 |
+
"content": "<extra_id_55>",
|
| 382 |
+
"lstrip": true,
|
| 383 |
+
"normalized": false,
|
| 384 |
+
"rstrip": true,
|
| 385 |
+
"single_word": false,
|
| 386 |
+
"special": true
|
| 387 |
+
},
|
| 388 |
+
"32045": {
|
| 389 |
+
"content": "<extra_id_54>",
|
| 390 |
+
"lstrip": true,
|
| 391 |
+
"normalized": false,
|
| 392 |
+
"rstrip": true,
|
| 393 |
+
"single_word": false,
|
| 394 |
+
"special": true
|
| 395 |
+
},
|
| 396 |
+
"32046": {
|
| 397 |
+
"content": "<extra_id_53>",
|
| 398 |
+
"lstrip": true,
|
| 399 |
+
"normalized": false,
|
| 400 |
+
"rstrip": true,
|
| 401 |
+
"single_word": false,
|
| 402 |
+
"special": true
|
| 403 |
+
},
|
| 404 |
+
"32047": {
|
| 405 |
+
"content": "<extra_id_52>",
|
| 406 |
+
"lstrip": true,
|
| 407 |
+
"normalized": false,
|
| 408 |
+
"rstrip": true,
|
| 409 |
+
"single_word": false,
|
| 410 |
+
"special": true
|
| 411 |
+
},
|
| 412 |
+
"32048": {
|
| 413 |
+
"content": "<extra_id_51>",
|
| 414 |
+
"lstrip": true,
|
| 415 |
+
"normalized": false,
|
| 416 |
+
"rstrip": true,
|
| 417 |
+
"single_word": false,
|
| 418 |
+
"special": true
|
| 419 |
+
},
|
| 420 |
+
"32049": {
|
| 421 |
+
"content": "<extra_id_50>",
|
| 422 |
+
"lstrip": true,
|
| 423 |
+
"normalized": false,
|
| 424 |
+
"rstrip": true,
|
| 425 |
+
"single_word": false,
|
| 426 |
+
"special": true
|
| 427 |
+
},
|
| 428 |
+
"32050": {
|
| 429 |
+
"content": "<extra_id_49>",
|
| 430 |
+
"lstrip": true,
|
| 431 |
+
"normalized": false,
|
| 432 |
+
"rstrip": true,
|
| 433 |
+
"single_word": false,
|
| 434 |
+
"special": true
|
| 435 |
+
},
|
| 436 |
+
"32051": {
|
| 437 |
+
"content": "<extra_id_48>",
|
| 438 |
+
"lstrip": true,
|
| 439 |
+
"normalized": false,
|
| 440 |
+
"rstrip": true,
|
| 441 |
+
"single_word": false,
|
| 442 |
+
"special": true
|
| 443 |
+
},
|
| 444 |
+
"32052": {
|
| 445 |
+
"content": "<extra_id_47>",
|
| 446 |
+
"lstrip": true,
|
| 447 |
+
"normalized": false,
|
| 448 |
+
"rstrip": true,
|
| 449 |
+
"single_word": false,
|
| 450 |
+
"special": true
|
| 451 |
+
},
|
| 452 |
+
"32053": {
|
| 453 |
+
"content": "<extra_id_46>",
|
| 454 |
+
"lstrip": true,
|
| 455 |
+
"normalized": false,
|
| 456 |
+
"rstrip": true,
|
| 457 |
+
"single_word": false,
|
| 458 |
+
"special": true
|
| 459 |
+
},
|
| 460 |
+
"32054": {
|
| 461 |
+
"content": "<extra_id_45>",
|
| 462 |
+
"lstrip": true,
|
| 463 |
+
"normalized": false,
|
| 464 |
+
"rstrip": true,
|
| 465 |
+
"single_word": false,
|
| 466 |
+
"special": true
|
| 467 |
+
},
|
| 468 |
+
"32055": {
|
| 469 |
+
"content": "<extra_id_44>",
|
| 470 |
+
"lstrip": true,
|
| 471 |
+
"normalized": false,
|
| 472 |
+
"rstrip": true,
|
| 473 |
+
"single_word": false,
|
| 474 |
+
"special": true
|
| 475 |
+
},
|
| 476 |
+
"32056": {
|
| 477 |
+
"content": "<extra_id_43>",
|
| 478 |
+
"lstrip": true,
|
| 479 |
+
"normalized": false,
|
| 480 |
+
"rstrip": true,
|
| 481 |
+
"single_word": false,
|
| 482 |
+
"special": true
|
| 483 |
+
},
|
| 484 |
+
"32057": {
|
| 485 |
+
"content": "<extra_id_42>",
|
| 486 |
+
"lstrip": true,
|
| 487 |
+
"normalized": false,
|
| 488 |
+
"rstrip": true,
|
| 489 |
+
"single_word": false,
|
| 490 |
+
"special": true
|
| 491 |
+
},
|
| 492 |
+
"32058": {
|
| 493 |
+
"content": "<extra_id_41>",
|
| 494 |
+
"lstrip": true,
|
| 495 |
+
"normalized": false,
|
| 496 |
+
"rstrip": true,
|
| 497 |
+
"single_word": false,
|
| 498 |
+
"special": true
|
| 499 |
+
},
|
| 500 |
+
"32059": {
|
| 501 |
+
"content": "<extra_id_40>",
|
| 502 |
+
"lstrip": true,
|
| 503 |
+
"normalized": false,
|
| 504 |
+
"rstrip": true,
|
| 505 |
+
"single_word": false,
|
| 506 |
+
"special": true
|
| 507 |
+
},
|
| 508 |
+
"32060": {
|
| 509 |
+
"content": "<extra_id_39>",
|
| 510 |
+
"lstrip": true,
|
| 511 |
+
"normalized": false,
|
| 512 |
+
"rstrip": true,
|
| 513 |
+
"single_word": false,
|
| 514 |
+
"special": true
|
| 515 |
+
},
|
| 516 |
+
"32061": {
|
| 517 |
+
"content": "<extra_id_38>",
|
| 518 |
+
"lstrip": true,
|
| 519 |
+
"normalized": false,
|
| 520 |
+
"rstrip": true,
|
| 521 |
+
"single_word": false,
|
| 522 |
+
"special": true
|
| 523 |
+
},
|
| 524 |
+
"32062": {
|
| 525 |
+
"content": "<extra_id_37>",
|
| 526 |
+
"lstrip": true,
|
| 527 |
+
"normalized": false,
|
| 528 |
+
"rstrip": true,
|
| 529 |
+
"single_word": false,
|
| 530 |
+
"special": true
|
| 531 |
+
},
|
| 532 |
+
"32063": {
|
| 533 |
+
"content": "<extra_id_36>",
|
| 534 |
+
"lstrip": true,
|
| 535 |
+
"normalized": false,
|
| 536 |
+
"rstrip": true,
|
| 537 |
+
"single_word": false,
|
| 538 |
+
"special": true
|
| 539 |
+
},
|
| 540 |
+
"32064": {
|
| 541 |
+
"content": "<extra_id_35>",
|
| 542 |
+
"lstrip": true,
|
| 543 |
+
"normalized": false,
|
| 544 |
+
"rstrip": true,
|
| 545 |
+
"single_word": false,
|
| 546 |
+
"special": true
|
| 547 |
+
},
|
| 548 |
+
"32065": {
|
| 549 |
+
"content": "<extra_id_34>",
|
| 550 |
+
"lstrip": true,
|
| 551 |
+
"normalized": false,
|
| 552 |
+
"rstrip": true,
|
| 553 |
+
"single_word": false,
|
| 554 |
+
"special": true
|
| 555 |
+
},
|
| 556 |
+
"32066": {
|
| 557 |
+
"content": "<extra_id_33>",
|
| 558 |
+
"lstrip": true,
|
| 559 |
+
"normalized": false,
|
| 560 |
+
"rstrip": true,
|
| 561 |
+
"single_word": false,
|
| 562 |
+
"special": true
|
| 563 |
+
},
|
| 564 |
+
"32067": {
|
| 565 |
+
"content": "<extra_id_32>",
|
| 566 |
+
"lstrip": true,
|
| 567 |
+
"normalized": false,
|
| 568 |
+
"rstrip": true,
|
| 569 |
+
"single_word": false,
|
| 570 |
+
"special": true
|
| 571 |
+
},
|
| 572 |
+
"32068": {
|
| 573 |
+
"content": "<extra_id_31>",
|
| 574 |
+
"lstrip": true,
|
| 575 |
+
"normalized": false,
|
| 576 |
+
"rstrip": true,
|
| 577 |
+
"single_word": false,
|
| 578 |
+
"special": true
|
| 579 |
+
},
|
| 580 |
+
"32069": {
|
| 581 |
+
"content": "<extra_id_30>",
|
| 582 |
+
"lstrip": true,
|
| 583 |
+
"normalized": false,
|
| 584 |
+
"rstrip": true,
|
| 585 |
+
"single_word": false,
|
| 586 |
+
"special": true
|
| 587 |
+
},
|
| 588 |
+
"32070": {
|
| 589 |
+
"content": "<extra_id_29>",
|
| 590 |
+
"lstrip": true,
|
| 591 |
+
"normalized": false,
|
| 592 |
+
"rstrip": true,
|
| 593 |
+
"single_word": false,
|
| 594 |
+
"special": true
|
| 595 |
+
},
|
| 596 |
+
"32071": {
|
| 597 |
+
"content": "<extra_id_28>",
|
| 598 |
+
"lstrip": true,
|
| 599 |
+
"normalized": false,
|
| 600 |
+
"rstrip": true,
|
| 601 |
+
"single_word": false,
|
| 602 |
+
"special": true
|
| 603 |
+
},
|
| 604 |
+
"32072": {
|
| 605 |
+
"content": "<extra_id_27>",
|
| 606 |
+
"lstrip": true,
|
| 607 |
+
"normalized": false,
|
| 608 |
+
"rstrip": true,
|
| 609 |
+
"single_word": false,
|
| 610 |
+
"special": true
|
| 611 |
+
},
|
| 612 |
+
"32073": {
|
| 613 |
+
"content": "<extra_id_26>",
|
| 614 |
+
"lstrip": true,
|
| 615 |
+
"normalized": false,
|
| 616 |
+
"rstrip": true,
|
| 617 |
+
"single_word": false,
|
| 618 |
+
"special": true
|
| 619 |
+
},
|
| 620 |
+
"32074": {
|
| 621 |
+
"content": "<extra_id_25>",
|
| 622 |
+
"lstrip": true,
|
| 623 |
+
"normalized": false,
|
| 624 |
+
"rstrip": true,
|
| 625 |
+
"single_word": false,
|
| 626 |
+
"special": true
|
| 627 |
+
},
|
| 628 |
+
"32075": {
|
| 629 |
+
"content": "<extra_id_24>",
|
| 630 |
+
"lstrip": true,
|
| 631 |
+
"normalized": false,
|
| 632 |
+
"rstrip": true,
|
| 633 |
+
"single_word": false,
|
| 634 |
+
"special": true
|
| 635 |
+
},
|
| 636 |
+
"32076": {
|
| 637 |
+
"content": "<extra_id_23>",
|
| 638 |
+
"lstrip": true,
|
| 639 |
+
"normalized": false,
|
| 640 |
+
"rstrip": true,
|
| 641 |
+
"single_word": false,
|
| 642 |
+
"special": true
|
| 643 |
+
},
|
| 644 |
+
"32077": {
|
| 645 |
+
"content": "<extra_id_22>",
|
| 646 |
+
"lstrip": true,
|
| 647 |
+
"normalized": false,
|
| 648 |
+
"rstrip": true,
|
| 649 |
+
"single_word": false,
|
| 650 |
+
"special": true
|
| 651 |
+
},
|
| 652 |
+
"32078": {
|
| 653 |
+
"content": "<extra_id_21>",
|
| 654 |
+
"lstrip": true,
|
| 655 |
+
"normalized": false,
|
| 656 |
+
"rstrip": true,
|
| 657 |
+
"single_word": false,
|
| 658 |
+
"special": true
|
| 659 |
+
},
|
| 660 |
+
"32079": {
|
| 661 |
+
"content": "<extra_id_20>",
|
| 662 |
+
"lstrip": true,
|
| 663 |
+
"normalized": false,
|
| 664 |
+
"rstrip": true,
|
| 665 |
+
"single_word": false,
|
| 666 |
+
"special": true
|
| 667 |
+
},
|
| 668 |
+
"32080": {
|
| 669 |
+
"content": "<extra_id_19>",
|
| 670 |
+
"lstrip": true,
|
| 671 |
+
"normalized": false,
|
| 672 |
+
"rstrip": true,
|
| 673 |
+
"single_word": false,
|
| 674 |
+
"special": true
|
| 675 |
+
},
|
| 676 |
+
"32081": {
|
| 677 |
+
"content": "<extra_id_18>",
|
| 678 |
+
"lstrip": true,
|
| 679 |
+
"normalized": false,
|
| 680 |
+
"rstrip": true,
|
| 681 |
+
"single_word": false,
|
| 682 |
+
"special": true
|
| 683 |
+
},
|
| 684 |
+
"32082": {
|
| 685 |
+
"content": "<extra_id_17>",
|
| 686 |
+
"lstrip": true,
|
| 687 |
+
"normalized": false,
|
| 688 |
+
"rstrip": true,
|
| 689 |
+
"single_word": false,
|
| 690 |
+
"special": true
|
| 691 |
+
},
|
| 692 |
+
"32083": {
|
| 693 |
+
"content": "<extra_id_16>",
|
| 694 |
+
"lstrip": true,
|
| 695 |
+
"normalized": false,
|
| 696 |
+
"rstrip": true,
|
| 697 |
+
"single_word": false,
|
| 698 |
+
"special": true
|
| 699 |
+
},
|
| 700 |
+
"32084": {
|
| 701 |
+
"content": "<extra_id_15>",
|
| 702 |
+
"lstrip": true,
|
| 703 |
+
"normalized": false,
|
| 704 |
+
"rstrip": true,
|
| 705 |
+
"single_word": false,
|
| 706 |
+
"special": true
|
| 707 |
+
},
|
| 708 |
+
"32085": {
|
| 709 |
+
"content": "<extra_id_14>",
|
| 710 |
+
"lstrip": true,
|
| 711 |
+
"normalized": false,
|
| 712 |
+
"rstrip": true,
|
| 713 |
+
"single_word": false,
|
| 714 |
+
"special": true
|
| 715 |
+
},
|
| 716 |
+
"32086": {
|
| 717 |
+
"content": "<extra_id_13>",
|
| 718 |
+
"lstrip": true,
|
| 719 |
+
"normalized": false,
|
| 720 |
+
"rstrip": true,
|
| 721 |
+
"single_word": false,
|
| 722 |
+
"special": true
|
| 723 |
+
},
|
| 724 |
+
"32087": {
|
| 725 |
+
"content": "<extra_id_12>",
|
| 726 |
+
"lstrip": true,
|
| 727 |
+
"normalized": false,
|
| 728 |
+
"rstrip": true,
|
| 729 |
+
"single_word": false,
|
| 730 |
+
"special": true
|
| 731 |
+
},
|
| 732 |
+
"32088": {
|
| 733 |
+
"content": "<extra_id_11>",
|
| 734 |
+
"lstrip": true,
|
| 735 |
+
"normalized": false,
|
| 736 |
+
"rstrip": true,
|
| 737 |
+
"single_word": false,
|
| 738 |
+
"special": true
|
| 739 |
+
},
|
| 740 |
+
"32089": {
|
| 741 |
+
"content": "<extra_id_10>",
|
| 742 |
+
"lstrip": true,
|
| 743 |
+
"normalized": false,
|
| 744 |
+
"rstrip": true,
|
| 745 |
+
"single_word": false,
|
| 746 |
+
"special": true
|
| 747 |
+
},
|
| 748 |
+
"32090": {
|
| 749 |
+
"content": "<extra_id_9>",
|
| 750 |
+
"lstrip": true,
|
| 751 |
+
"normalized": false,
|
| 752 |
+
"rstrip": true,
|
| 753 |
+
"single_word": false,
|
| 754 |
+
"special": true
|
| 755 |
+
},
|
| 756 |
+
"32091": {
|
| 757 |
+
"content": "<extra_id_8>",
|
| 758 |
+
"lstrip": true,
|
| 759 |
+
"normalized": false,
|
| 760 |
+
"rstrip": true,
|
| 761 |
+
"single_word": false,
|
| 762 |
+
"special": true
|
| 763 |
+
},
|
| 764 |
+
"32092": {
|
| 765 |
+
"content": "<extra_id_7>",
|
| 766 |
+
"lstrip": true,
|
| 767 |
+
"normalized": false,
|
| 768 |
+
"rstrip": true,
|
| 769 |
+
"single_word": false,
|
| 770 |
+
"special": true
|
| 771 |
+
},
|
| 772 |
+
"32093": {
|
| 773 |
+
"content": "<extra_id_6>",
|
| 774 |
+
"lstrip": true,
|
| 775 |
+
"normalized": false,
|
| 776 |
+
"rstrip": true,
|
| 777 |
+
"single_word": false,
|
| 778 |
+
"special": true
|
| 779 |
+
},
|
| 780 |
+
"32094": {
|
| 781 |
+
"content": "<extra_id_5>",
|
| 782 |
+
"lstrip": true,
|
| 783 |
+
"normalized": false,
|
| 784 |
+
"rstrip": true,
|
| 785 |
+
"single_word": false,
|
| 786 |
+
"special": true
|
| 787 |
+
},
|
| 788 |
+
"32095": {
|
| 789 |
+
"content": "<extra_id_4>",
|
| 790 |
+
"lstrip": true,
|
| 791 |
+
"normalized": false,
|
| 792 |
+
"rstrip": true,
|
| 793 |
+
"single_word": false,
|
| 794 |
+
"special": true
|
| 795 |
+
},
|
| 796 |
+
"32096": {
|
| 797 |
+
"content": "<extra_id_3>",
|
| 798 |
+
"lstrip": true,
|
| 799 |
+
"normalized": false,
|
| 800 |
+
"rstrip": true,
|
| 801 |
+
"single_word": false,
|
| 802 |
+
"special": true
|
| 803 |
+
},
|
| 804 |
+
"32097": {
|
| 805 |
+
"content": "<extra_id_2>",
|
| 806 |
+
"lstrip": true,
|
| 807 |
+
"normalized": false,
|
| 808 |
+
"rstrip": true,
|
| 809 |
+
"single_word": false,
|
| 810 |
+
"special": true
|
| 811 |
+
},
|
| 812 |
+
"32098": {
|
| 813 |
+
"content": "<extra_id_1>",
|
| 814 |
+
"lstrip": true,
|
| 815 |
+
"normalized": false,
|
| 816 |
+
"rstrip": true,
|
| 817 |
+
"single_word": false,
|
| 818 |
+
"special": true
|
| 819 |
+
},
|
| 820 |
+
"32099": {
|
| 821 |
+
"content": "<extra_id_0>",
|
| 822 |
+
"lstrip": true,
|
| 823 |
+
"normalized": false,
|
| 824 |
+
"rstrip": true,
|
| 825 |
+
"single_word": false,
|
| 826 |
+
"special": true
|
| 827 |
+
}
|
| 828 |
+
},
|
| 829 |
+
"additional_special_tokens": [
|
| 830 |
+
"<extra_id_0>",
|
| 831 |
+
"<extra_id_1>",
|
| 832 |
+
"<extra_id_2>",
|
| 833 |
+
"<extra_id_3>",
|
| 834 |
+
"<extra_id_4>",
|
| 835 |
+
"<extra_id_5>",
|
| 836 |
+
"<extra_id_6>",
|
| 837 |
+
"<extra_id_7>",
|
| 838 |
+
"<extra_id_8>",
|
| 839 |
+
"<extra_id_9>",
|
| 840 |
+
"<extra_id_10>",
|
| 841 |
+
"<extra_id_11>",
|
| 842 |
+
"<extra_id_12>",
|
| 843 |
+
"<extra_id_13>",
|
| 844 |
+
"<extra_id_14>",
|
| 845 |
+
"<extra_id_15>",
|
| 846 |
+
"<extra_id_16>",
|
| 847 |
+
"<extra_id_17>",
|
| 848 |
+
"<extra_id_18>",
|
| 849 |
+
"<extra_id_19>",
|
| 850 |
+
"<extra_id_20>",
|
| 851 |
+
"<extra_id_21>",
|
| 852 |
+
"<extra_id_22>",
|
| 853 |
+
"<extra_id_23>",
|
| 854 |
+
"<extra_id_24>",
|
| 855 |
+
"<extra_id_25>",
|
| 856 |
+
"<extra_id_26>",
|
| 857 |
+
"<extra_id_27>",
|
| 858 |
+
"<extra_id_28>",
|
| 859 |
+
"<extra_id_29>",
|
| 860 |
+
"<extra_id_30>",
|
| 861 |
+
"<extra_id_31>",
|
| 862 |
+
"<extra_id_32>",
|
| 863 |
+
"<extra_id_33>",
|
| 864 |
+
"<extra_id_34>",
|
| 865 |
+
"<extra_id_35>",
|
| 866 |
+
"<extra_id_36>",
|
| 867 |
+
"<extra_id_37>",
|
| 868 |
+
"<extra_id_38>",
|
| 869 |
+
"<extra_id_39>",
|
| 870 |
+
"<extra_id_40>",
|
| 871 |
+
"<extra_id_41>",
|
| 872 |
+
"<extra_id_42>",
|
| 873 |
+
"<extra_id_43>",
|
| 874 |
+
"<extra_id_44>",
|
| 875 |
+
"<extra_id_45>",
|
| 876 |
+
"<extra_id_46>",
|
| 877 |
+
"<extra_id_47>",
|
| 878 |
+
"<extra_id_48>",
|
| 879 |
+
"<extra_id_49>",
|
| 880 |
+
"<extra_id_50>",
|
| 881 |
+
"<extra_id_51>",
|
| 882 |
+
"<extra_id_52>",
|
| 883 |
+
"<extra_id_53>",
|
| 884 |
+
"<extra_id_54>",
|
| 885 |
+
"<extra_id_55>",
|
| 886 |
+
"<extra_id_56>",
|
| 887 |
+
"<extra_id_57>",
|
| 888 |
+
"<extra_id_58>",
|
| 889 |
+
"<extra_id_59>",
|
| 890 |
+
"<extra_id_60>",
|
| 891 |
+
"<extra_id_61>",
|
| 892 |
+
"<extra_id_62>",
|
| 893 |
+
"<extra_id_63>",
|
| 894 |
+
"<extra_id_64>",
|
| 895 |
+
"<extra_id_65>",
|
| 896 |
+
"<extra_id_66>",
|
| 897 |
+
"<extra_id_67>",
|
| 898 |
+
"<extra_id_68>",
|
| 899 |
+
"<extra_id_69>",
|
| 900 |
+
"<extra_id_70>",
|
| 901 |
+
"<extra_id_71>",
|
| 902 |
+
"<extra_id_72>",
|
| 903 |
+
"<extra_id_73>",
|
| 904 |
+
"<extra_id_74>",
|
| 905 |
+
"<extra_id_75>",
|
| 906 |
+
"<extra_id_76>",
|
| 907 |
+
"<extra_id_77>",
|
| 908 |
+
"<extra_id_78>",
|
| 909 |
+
"<extra_id_79>",
|
| 910 |
+
"<extra_id_80>",
|
| 911 |
+
"<extra_id_81>",
|
| 912 |
+
"<extra_id_82>",
|
| 913 |
+
"<extra_id_83>",
|
| 914 |
+
"<extra_id_84>",
|
| 915 |
+
"<extra_id_85>",
|
| 916 |
+
"<extra_id_86>",
|
| 917 |
+
"<extra_id_87>",
|
| 918 |
+
"<extra_id_88>",
|
| 919 |
+
"<extra_id_89>",
|
| 920 |
+
"<extra_id_90>",
|
| 921 |
+
"<extra_id_91>",
|
| 922 |
+
"<extra_id_92>",
|
| 923 |
+
"<extra_id_93>",
|
| 924 |
+
"<extra_id_94>",
|
| 925 |
+
"<extra_id_95>",
|
| 926 |
+
"<extra_id_96>",
|
| 927 |
+
"<extra_id_97>",
|
| 928 |
+
"<extra_id_98>",
|
| 929 |
+
"<extra_id_99>"
|
| 930 |
+
],
|
| 931 |
+
"clean_up_tokenization_spaces": true,
|
| 932 |
+
"eos_token": "</s>",
|
| 933 |
+
"extra_ids": 100,
|
| 934 |
+
"legacy": true,
|
| 935 |
+
"model_max_length": 512,
|
| 936 |
+
"pad_token": "<pad>",
|
| 937 |
+
"sp_model_kwargs": {},
|
| 938 |
+
"tokenizer_class": "T5Tokenizer",
|
| 939 |
+
"unk_token": "<unk>"
|
| 940 |
+
}
|
transformer/config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "GeoCoreTransformer2DModel",
|
| 3 |
+
"_diffusers_version": "0.32.0",
|
| 4 |
+
"in_channels": 128,
|
| 5 |
+
"context_in_dim": 4096,
|
| 6 |
+
"hidden_size": 4096,
|
| 7 |
+
"num_heads": 32,
|
| 8 |
+
"depth": 8,
|
| 9 |
+
"depth_repa": 8,
|
| 10 |
+
"depth_single_blocks": 24,
|
| 11 |
+
"axes_dim": [
|
| 12 |
+
32,
|
| 13 |
+
48,
|
| 14 |
+
48
|
| 15 |
+
],
|
| 16 |
+
"theta": 2000,
|
| 17 |
+
"mlp_ratio": 3.0,
|
| 18 |
+
"y_in_dim": 768,
|
| 19 |
+
"z_out_dim": 4096,
|
| 20 |
+
"model_size": "9b",
|
| 21 |
+
"sample_size": 16,
|
| 22 |
+
"patch_size": 2,
|
| 23 |
+
"latent_channels": 128,
|
| 24 |
+
"weights": "model",
|
| 25 |
+
"training_steps": 300000
|
| 26 |
+
}
|
transformer/diffusion_pytorch_model-00001-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:37867b56a02748c67fe64f60118b6b6cd6966653026ba101abd1bf849e4f4b37
|
| 3 |
+
size 4948246312
|
transformer/diffusion_pytorch_model-00002-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:561831477a146da51524beacbd28e4e4db9c3d66318c98388823e641e920a956
|
| 3 |
+
size 4966067040
|
transformer/diffusion_pytorch_model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:60107ab28114906426b4187bbca9fda59af121318cb39543a90697b7a7ecef9a
|
| 3 |
+
size 4932512840
|
transformer/diffusion_pytorch_model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7cef9bd84c652cb25d0868d0f06d3cc4279d8a066db219f9c5f3fb4c7ac7288a
|
| 3 |
+
size 3624934504
|
transformer/diffusion_pytorch_model.safetensors.index.json
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 18471736832
|
| 4 |
+
},
|
| 5 |
+
"weight_map": {
|
| 6 |
+
"double_blocks.0.img_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 7 |
+
"double_blocks.0.img_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 8 |
+
"double_blocks.0.img_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 9 |
+
"double_blocks.0.img_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 10 |
+
"double_blocks.0.img_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 11 |
+
"double_blocks.0.img_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 12 |
+
"double_blocks.0.txt_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 13 |
+
"double_blocks.0.txt_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 14 |
+
"double_blocks.0.txt_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 15 |
+
"double_blocks.0.txt_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 16 |
+
"double_blocks.0.txt_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 17 |
+
"double_blocks.0.txt_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 18 |
+
"double_blocks.1.img_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 19 |
+
"double_blocks.1.img_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 20 |
+
"double_blocks.1.img_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 21 |
+
"double_blocks.1.img_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 22 |
+
"double_blocks.1.img_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 23 |
+
"double_blocks.1.img_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 24 |
+
"double_blocks.1.txt_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 25 |
+
"double_blocks.1.txt_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 26 |
+
"double_blocks.1.txt_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 27 |
+
"double_blocks.1.txt_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 28 |
+
"double_blocks.1.txt_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 29 |
+
"double_blocks.1.txt_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 30 |
+
"double_blocks.2.img_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 31 |
+
"double_blocks.2.img_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 32 |
+
"double_blocks.2.img_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 33 |
+
"double_blocks.2.img_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 34 |
+
"double_blocks.2.img_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 35 |
+
"double_blocks.2.img_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 36 |
+
"double_blocks.2.txt_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 37 |
+
"double_blocks.2.txt_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 38 |
+
"double_blocks.2.txt_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 39 |
+
"double_blocks.2.txt_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 40 |
+
"double_blocks.2.txt_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 41 |
+
"double_blocks.2.txt_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 42 |
+
"double_blocks.3.img_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 43 |
+
"double_blocks.3.img_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 44 |
+
"double_blocks.3.img_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 45 |
+
"double_blocks.3.img_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 46 |
+
"double_blocks.3.img_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 47 |
+
"double_blocks.3.img_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 48 |
+
"double_blocks.3.txt_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 49 |
+
"double_blocks.3.txt_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 50 |
+
"double_blocks.3.txt_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 51 |
+
"double_blocks.3.txt_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 52 |
+
"double_blocks.3.txt_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 53 |
+
"double_blocks.3.txt_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 54 |
+
"double_blocks.4.img_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 55 |
+
"double_blocks.4.img_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 56 |
+
"double_blocks.4.img_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 57 |
+
"double_blocks.4.img_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 58 |
+
"double_blocks.4.img_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 59 |
+
"double_blocks.4.img_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 60 |
+
"double_blocks.4.txt_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 61 |
+
"double_blocks.4.txt_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 62 |
+
"double_blocks.4.txt_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 63 |
+
"double_blocks.4.txt_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 64 |
+
"double_blocks.4.txt_mlp.0.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 65 |
+
"double_blocks.4.txt_mlp.2.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 66 |
+
"double_blocks.5.img_attn.norm.key_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 67 |
+
"double_blocks.5.img_attn.norm.query_norm.scale": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 68 |
+
"double_blocks.5.img_attn.proj.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 69 |
+
"double_blocks.5.img_attn.qkv.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 70 |
+
"img_in.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 71 |
+
"lat_in.in_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 72 |
+
"lat_in.out_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 73 |
+
"lon_in.in_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 74 |
+
"lon_in.out_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 75 |
+
"null_lat_emb": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 76 |
+
"null_lon_emb": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 77 |
+
"null_res_emb": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 78 |
+
"repa_out.in_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 79 |
+
"repa_out.middle_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 80 |
+
"repa_out.out_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 81 |
+
"res_in.in_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 82 |
+
"res_in.out_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 83 |
+
"time_in.in_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 84 |
+
"time_in.out_layer.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 85 |
+
"txt_in.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 86 |
+
"y_in.weight": "diffusion_pytorch_model-00001-of-00004.safetensors",
|
| 87 |
+
"double_blocks.5.img_mlp.0.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 88 |
+
"double_blocks.5.img_mlp.2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 89 |
+
"double_blocks.5.txt_attn.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 90 |
+
"double_blocks.5.txt_attn.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 91 |
+
"double_blocks.5.txt_attn.proj.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 92 |
+
"double_blocks.5.txt_attn.qkv.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 93 |
+
"double_blocks.5.txt_mlp.0.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 94 |
+
"double_blocks.5.txt_mlp.2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 95 |
+
"double_blocks.6.img_attn.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 96 |
+
"double_blocks.6.img_attn.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 97 |
+
"double_blocks.6.img_attn.proj.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 98 |
+
"double_blocks.6.img_attn.qkv.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 99 |
+
"double_blocks.6.img_mlp.0.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 100 |
+
"double_blocks.6.img_mlp.2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 101 |
+
"double_blocks.6.txt_attn.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 102 |
+
"double_blocks.6.txt_attn.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 103 |
+
"double_blocks.6.txt_attn.proj.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 104 |
+
"double_blocks.6.txt_attn.qkv.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 105 |
+
"double_blocks.6.txt_mlp.0.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 106 |
+
"double_blocks.6.txt_mlp.2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 107 |
+
"double_blocks.7.img_attn.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 108 |
+
"double_blocks.7.img_attn.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 109 |
+
"double_blocks.7.img_attn.proj.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 110 |
+
"double_blocks.7.img_attn.qkv.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 111 |
+
"double_blocks.7.img_mlp.0.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 112 |
+
"double_blocks.7.img_mlp.2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 113 |
+
"double_blocks.7.txt_attn.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 114 |
+
"double_blocks.7.txt_attn.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 115 |
+
"double_blocks.7.txt_attn.proj.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 116 |
+
"double_blocks.7.txt_attn.qkv.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 117 |
+
"double_blocks.7.txt_mlp.0.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 118 |
+
"double_blocks.7.txt_mlp.2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 119 |
+
"single_blocks.0.linear1.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 120 |
+
"single_blocks.0.linear2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 121 |
+
"single_blocks.0.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 122 |
+
"single_blocks.0.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 123 |
+
"single_blocks.1.linear1.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 124 |
+
"single_blocks.1.linear2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 125 |
+
"single_blocks.1.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 126 |
+
"single_blocks.1.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 127 |
+
"single_blocks.2.linear1.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 128 |
+
"single_blocks.2.linear2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 129 |
+
"single_blocks.2.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 130 |
+
"single_blocks.2.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 131 |
+
"single_blocks.3.linear1.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 132 |
+
"single_blocks.3.linear2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 133 |
+
"single_blocks.3.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 134 |
+
"single_blocks.3.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 135 |
+
"single_blocks.4.linear1.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 136 |
+
"single_blocks.4.linear2.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 137 |
+
"single_blocks.4.norm.key_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 138 |
+
"single_blocks.4.norm.query_norm.scale": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 139 |
+
"single_blocks.5.linear1.weight": "diffusion_pytorch_model-00002-of-00004.safetensors",
|
| 140 |
+
"single_blocks.10.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 141 |
+
"single_blocks.10.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 142 |
+
"single_blocks.10.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 143 |
+
"single_blocks.10.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 144 |
+
"single_blocks.11.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 145 |
+
"single_blocks.11.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 146 |
+
"single_blocks.11.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 147 |
+
"single_blocks.11.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 148 |
+
"single_blocks.12.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 149 |
+
"single_blocks.12.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 150 |
+
"single_blocks.12.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 151 |
+
"single_blocks.12.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 152 |
+
"single_blocks.13.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 153 |
+
"single_blocks.13.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 154 |
+
"single_blocks.13.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 155 |
+
"single_blocks.13.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 156 |
+
"single_blocks.14.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 157 |
+
"single_blocks.14.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 158 |
+
"single_blocks.14.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 159 |
+
"single_blocks.14.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 160 |
+
"single_blocks.15.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 161 |
+
"single_blocks.15.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 162 |
+
"single_blocks.15.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 163 |
+
"single_blocks.15.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 164 |
+
"single_blocks.16.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 165 |
+
"single_blocks.16.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 166 |
+
"single_blocks.16.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 167 |
+
"single_blocks.16.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 168 |
+
"single_blocks.5.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 169 |
+
"single_blocks.5.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 170 |
+
"single_blocks.5.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 171 |
+
"single_blocks.6.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 172 |
+
"single_blocks.6.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 173 |
+
"single_blocks.6.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 174 |
+
"single_blocks.6.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 175 |
+
"single_blocks.7.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 176 |
+
"single_blocks.7.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 177 |
+
"single_blocks.7.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 178 |
+
"single_blocks.7.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 179 |
+
"single_blocks.8.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 180 |
+
"single_blocks.8.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 181 |
+
"single_blocks.8.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 182 |
+
"single_blocks.8.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 183 |
+
"single_blocks.9.linear1.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 184 |
+
"single_blocks.9.linear2.weight": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 185 |
+
"single_blocks.9.norm.key_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 186 |
+
"single_blocks.9.norm.query_norm.scale": "diffusion_pytorch_model-00003-of-00004.safetensors",
|
| 187 |
+
"double_stream_modulation_img.lin.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 188 |
+
"double_stream_modulation_txt.lin.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 189 |
+
"final_layer.adaLN_modulation.1.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 190 |
+
"final_layer.linear.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 191 |
+
"single_blocks.17.linear1.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 192 |
+
"single_blocks.17.linear2.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 193 |
+
"single_blocks.17.norm.key_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 194 |
+
"single_blocks.17.norm.query_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 195 |
+
"single_blocks.18.linear1.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 196 |
+
"single_blocks.18.linear2.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 197 |
+
"single_blocks.18.norm.key_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 198 |
+
"single_blocks.18.norm.query_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 199 |
+
"single_blocks.19.linear1.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 200 |
+
"single_blocks.19.linear2.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 201 |
+
"single_blocks.19.norm.key_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 202 |
+
"single_blocks.19.norm.query_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 203 |
+
"single_blocks.20.linear1.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 204 |
+
"single_blocks.20.linear2.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 205 |
+
"single_blocks.20.norm.key_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 206 |
+
"single_blocks.20.norm.query_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 207 |
+
"single_blocks.21.linear1.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 208 |
+
"single_blocks.21.linear2.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 209 |
+
"single_blocks.21.norm.key_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 210 |
+
"single_blocks.21.norm.query_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 211 |
+
"single_blocks.22.linear1.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 212 |
+
"single_blocks.22.linear2.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 213 |
+
"single_blocks.22.norm.key_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 214 |
+
"single_blocks.22.norm.query_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 215 |
+
"single_blocks.23.linear1.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 216 |
+
"single_blocks.23.linear2.weight": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 217 |
+
"single_blocks.23.norm.key_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 218 |
+
"single_blocks.23.norm.query_norm.scale": "diffusion_pytorch_model-00004-of-00004.safetensors",
|
| 219 |
+
"single_stream_modulation.lin.weight": "diffusion_pytorch_model-00004-of-00004.safetensors"
|
| 220 |
+
}
|
| 221 |
+
}
|
transformer/transformer_geocore.py
ADDED
|
@@ -0,0 +1,767 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2026 Jeonghyeok Do and Munchurl Kim. All rights reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
"""GeoCore Flow Matching DiT transformer (self-contained Diffusers model).
|
| 15 |
+
|
| 16 |
+
Architecture is adapted from the FLUX.2 reference implementation by Black Forest Labs
|
| 17 |
+
(https://github.com/black-forest-labs/flux), licensed under Apache-2.0, with GeoCore
|
| 18 |
+
geospatial metadata conditioning and the GSA projection head.
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
from __future__ import annotations
|
| 22 |
+
|
| 23 |
+
import math
|
| 24 |
+
from typing import Any
|
| 25 |
+
|
| 26 |
+
import torch
|
| 27 |
+
from diffusers.configuration_utils import ConfigMixin, register_to_config
|
| 28 |
+
from diffusers.models.modeling_utils import ModelMixin
|
| 29 |
+
from einops import rearrange
|
| 30 |
+
from torch import Tensor, nn
|
| 31 |
+
from torch.nn import functional as F
|
| 32 |
+
from torch.utils.checkpoint import checkpoint
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
class SelfAttention(nn.Module):
|
| 36 |
+
def __init__(
|
| 37 |
+
self,
|
| 38 |
+
dim: int,
|
| 39 |
+
num_heads: int = 8,
|
| 40 |
+
):
|
| 41 |
+
super().__init__()
|
| 42 |
+
self.num_heads = num_heads
|
| 43 |
+
head_dim = dim // num_heads
|
| 44 |
+
self.qkv = nn.Linear(dim, dim * 3, bias=False)
|
| 45 |
+
|
| 46 |
+
self.norm = QKNorm(head_dim)
|
| 47 |
+
self.proj = nn.Linear(dim, dim, bias=False)
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
class SiLUActivation(nn.Module):
|
| 51 |
+
def __init__(self):
|
| 52 |
+
super().__init__()
|
| 53 |
+
self.gate_fn = nn.SiLU()
|
| 54 |
+
|
| 55 |
+
def forward(self, x: Tensor) -> Tensor:
|
| 56 |
+
x1, x2 = x.chunk(2, dim=-1)
|
| 57 |
+
return self.gate_fn(x1) * x2
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
class Modulation(nn.Module):
|
| 61 |
+
def __init__(self, dim: int, double: bool, disable_bias: bool = False):
|
| 62 |
+
super().__init__()
|
| 63 |
+
self.is_double = double
|
| 64 |
+
self.multiplier = 6 if double else 3
|
| 65 |
+
self.lin = nn.Linear(dim, self.multiplier * dim, bias=not disable_bias)
|
| 66 |
+
|
| 67 |
+
def forward(self, vec: torch.Tensor):
|
| 68 |
+
out = self.lin(nn.functional.silu(vec))
|
| 69 |
+
if out.ndim == 2:
|
| 70 |
+
out = out[:, None, :]
|
| 71 |
+
out = out.chunk(self.multiplier, dim=-1)
|
| 72 |
+
return out[:3], out[3:] if self.is_double else None
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
class LastLayer(nn.Module):
|
| 76 |
+
def __init__(
|
| 77 |
+
self,
|
| 78 |
+
hidden_size: int,
|
| 79 |
+
out_channels: int,
|
| 80 |
+
):
|
| 81 |
+
super().__init__()
|
| 82 |
+
self.norm_final = nn.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6)
|
| 83 |
+
self.linear = nn.Linear(hidden_size, out_channels, bias=False)
|
| 84 |
+
self.adaLN_modulation = nn.Sequential(nn.SiLU(), nn.Linear(hidden_size, 2 * hidden_size, bias=False))
|
| 85 |
+
|
| 86 |
+
def forward(self, x: torch.Tensor, vec: torch.Tensor) -> torch.Tensor:
|
| 87 |
+
mod = self.adaLN_modulation(vec)
|
| 88 |
+
shift, scale = mod.chunk(2, dim=-1)
|
| 89 |
+
if shift.ndim == 2:
|
| 90 |
+
shift = shift[:, None, :]
|
| 91 |
+
scale = scale[:, None, :]
|
| 92 |
+
x = (1 + scale) * self.norm_final(x) + shift
|
| 93 |
+
x = self.linear(x)
|
| 94 |
+
return x
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
class SingleStreamBlock(nn.Module):
|
| 98 |
+
def __init__(
|
| 99 |
+
self,
|
| 100 |
+
hidden_size: int,
|
| 101 |
+
num_heads: int,
|
| 102 |
+
mlp_ratio: float = 4.0,
|
| 103 |
+
):
|
| 104 |
+
super().__init__()
|
| 105 |
+
|
| 106 |
+
self.hidden_dim = hidden_size
|
| 107 |
+
self.num_heads = num_heads
|
| 108 |
+
head_dim = hidden_size // num_heads
|
| 109 |
+
self.scale = head_dim**-0.5
|
| 110 |
+
self.mlp_hidden_dim = int(hidden_size * mlp_ratio)
|
| 111 |
+
self.mlp_mult_factor = 2
|
| 112 |
+
|
| 113 |
+
self.linear1 = nn.Linear(
|
| 114 |
+
hidden_size,
|
| 115 |
+
hidden_size * 3 + self.mlp_hidden_dim * self.mlp_mult_factor,
|
| 116 |
+
bias=False,
|
| 117 |
+
)
|
| 118 |
+
|
| 119 |
+
self.linear2 = nn.Linear(hidden_size + self.mlp_hidden_dim, hidden_size, bias=False)
|
| 120 |
+
|
| 121 |
+
self.norm = QKNorm(head_dim)
|
| 122 |
+
|
| 123 |
+
self.hidden_size = hidden_size
|
| 124 |
+
self.pre_norm = nn.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6)
|
| 125 |
+
|
| 126 |
+
self.mlp_act = SiLUActivation()
|
| 127 |
+
|
| 128 |
+
def forward(
|
| 129 |
+
self,
|
| 130 |
+
x: Tensor,
|
| 131 |
+
pe: Tensor,
|
| 132 |
+
mod: tuple[Tensor, Tensor, Tensor],
|
| 133 |
+
num_txt_tokens: int,
|
| 134 |
+
num_ref_tokens: int = 0,
|
| 135 |
+
) -> tuple[Tensor, dict]:
|
| 136 |
+
"""Entry point used at inference so accelerate device_map hooks can move tensors."""
|
| 137 |
+
return self.forward_kv_extract(x, pe, mod, num_txt_tokens, num_ref_tokens)
|
| 138 |
+
|
| 139 |
+
def _qkv(self, x: Tensor, mod: tuple[Tensor, Tensor, Tensor]):
|
| 140 |
+
mod_shift, mod_scale, mod_gate = mod
|
| 141 |
+
x_mod = (1 + mod_scale) * self.pre_norm(x) + mod_shift
|
| 142 |
+
|
| 143 |
+
qkv, mlp = torch.split(
|
| 144 |
+
self.linear1(x_mod),
|
| 145 |
+
[3 * self.hidden_size, self.mlp_hidden_dim * self.mlp_mult_factor],
|
| 146 |
+
dim=-1,
|
| 147 |
+
)
|
| 148 |
+
|
| 149 |
+
q, k, v = rearrange(qkv, "B L (K H D) -> K B H L D", K=3, H=self.num_heads)
|
| 150 |
+
q, k = self.norm(q, k, v)
|
| 151 |
+
return q, k, v, mlp, mod_gate
|
| 152 |
+
|
| 153 |
+
def _out(self, x: Tensor, attn: Tensor, mlp: Tensor, mod_gate: Tensor) -> Tensor:
|
| 154 |
+
output = self.linear2(torch.cat((attn, self.mlp_act(mlp)), 2))
|
| 155 |
+
return x + mod_gate * output
|
| 156 |
+
|
| 157 |
+
def forward_kv_extract(
|
| 158 |
+
self,
|
| 159 |
+
x: Tensor,
|
| 160 |
+
pe: Tensor,
|
| 161 |
+
mod: tuple[Tensor, Tensor, Tensor],
|
| 162 |
+
num_txt_tokens: int,
|
| 163 |
+
num_ref_tokens: int,
|
| 164 |
+
) -> tuple[Tensor, dict]:
|
| 165 |
+
"""Forward with causal attention. Extracts and returns ref KV cache."""
|
| 166 |
+
q, k, v, mlp, mod_gate = self._qkv(x, mod)
|
| 167 |
+
q, k = apply_rope(q, k, pe)
|
| 168 |
+
|
| 169 |
+
ref_start = num_txt_tokens
|
| 170 |
+
ref_end = num_txt_tokens + num_ref_tokens
|
| 171 |
+
cache = {
|
| 172 |
+
"k_ref": k[:, :, ref_start:ref_end, :].clone(),
|
| 173 |
+
"v_ref": v[:, :, ref_start:ref_end, :].clone(),
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
attn = causal_attn_fn(q, k, v, num_txt_tokens, num_ref_tokens)
|
| 177 |
+
return self._out(x, attn, mlp, mod_gate), cache
|
| 178 |
+
|
| 179 |
+
def forward_kv_cached(
|
| 180 |
+
self,
|
| 181 |
+
x: Tensor,
|
| 182 |
+
pe: Tensor,
|
| 183 |
+
mod: tuple[Tensor, Tensor, Tensor],
|
| 184 |
+
num_txt_tokens: int,
|
| 185 |
+
kv_cache: dict,
|
| 186 |
+
) -> Tensor:
|
| 187 |
+
"""Forward using cached ref KV. Input x has layout [txt, img] (no ref)."""
|
| 188 |
+
q, k, v, mlp, mod_gate = self._qkv(x, mod)
|
| 189 |
+
q, k = apply_rope(q, k, pe)
|
| 190 |
+
num_ref_tokens = kv_cache["k_ref"].shape[2]
|
| 191 |
+
attn = causal_attn_fn(q, k, v, num_txt_tokens, num_ref_tokens, kv_cache)
|
| 192 |
+
return self._out(x, attn, mlp, mod_gate)
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
class DoubleStreamBlock(nn.Module):
|
| 196 |
+
def __init__(
|
| 197 |
+
self,
|
| 198 |
+
hidden_size: int,
|
| 199 |
+
num_heads: int,
|
| 200 |
+
mlp_ratio: float,
|
| 201 |
+
):
|
| 202 |
+
super().__init__()
|
| 203 |
+
mlp_hidden_dim = int(hidden_size * mlp_ratio)
|
| 204 |
+
self.num_heads = num_heads
|
| 205 |
+
assert hidden_size % num_heads == 0, f"{hidden_size=} must be divisible by {num_heads=}"
|
| 206 |
+
|
| 207 |
+
self.hidden_size = hidden_size
|
| 208 |
+
self.img_norm1 = nn.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6)
|
| 209 |
+
self.mlp_mult_factor = 2
|
| 210 |
+
|
| 211 |
+
self.img_attn = SelfAttention(
|
| 212 |
+
dim=hidden_size,
|
| 213 |
+
num_heads=num_heads,
|
| 214 |
+
)
|
| 215 |
+
|
| 216 |
+
self.img_norm2 = nn.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6)
|
| 217 |
+
self.img_mlp = nn.Sequential(
|
| 218 |
+
nn.Linear(hidden_size, mlp_hidden_dim * self.mlp_mult_factor, bias=False),
|
| 219 |
+
SiLUActivation(),
|
| 220 |
+
nn.Linear(mlp_hidden_dim, hidden_size, bias=False),
|
| 221 |
+
)
|
| 222 |
+
|
| 223 |
+
self.txt_norm1 = nn.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6)
|
| 224 |
+
self.txt_attn = SelfAttention(
|
| 225 |
+
dim=hidden_size,
|
| 226 |
+
num_heads=num_heads,
|
| 227 |
+
)
|
| 228 |
+
|
| 229 |
+
self.txt_norm2 = nn.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6)
|
| 230 |
+
self.txt_mlp = nn.Sequential(
|
| 231 |
+
nn.Linear(
|
| 232 |
+
hidden_size,
|
| 233 |
+
mlp_hidden_dim * self.mlp_mult_factor,
|
| 234 |
+
bias=False,
|
| 235 |
+
),
|
| 236 |
+
SiLUActivation(),
|
| 237 |
+
nn.Linear(mlp_hidden_dim, hidden_size, bias=False),
|
| 238 |
+
)
|
| 239 |
+
|
| 240 |
+
def forward(
|
| 241 |
+
self,
|
| 242 |
+
img: Tensor,
|
| 243 |
+
txt: Tensor,
|
| 244 |
+
pe: Tensor,
|
| 245 |
+
pe_ctx: Tensor,
|
| 246 |
+
mod_img: tuple[Tensor, Tensor],
|
| 247 |
+
mod_txt: tuple[Tensor, Tensor],
|
| 248 |
+
num_ref_tokens: int = 0,
|
| 249 |
+
) -> tuple[Tensor, Tensor, dict]:
|
| 250 |
+
"""Entry point used at inference so accelerate device_map hooks can move tensors."""
|
| 251 |
+
return self.forward_kv_extract(img, txt, pe, pe_ctx, mod_img, mod_txt, num_ref_tokens)
|
| 252 |
+
|
| 253 |
+
def _prepare_qkv(self, img, txt, pe, pe_ctx, mod_img, mod_txt):
|
| 254 |
+
img_mod1, img_mod2 = mod_img
|
| 255 |
+
txt_mod1, txt_mod2 = mod_txt
|
| 256 |
+
|
| 257 |
+
img_mod1_shift, img_mod1_scale, img_mod1_gate = img_mod1
|
| 258 |
+
img_mod2_shift, img_mod2_scale, img_mod2_gate = img_mod2
|
| 259 |
+
txt_mod1_shift, txt_mod1_scale, txt_mod1_gate = txt_mod1
|
| 260 |
+
txt_mod2_shift, txt_mod2_scale, txt_mod2_gate = txt_mod2
|
| 261 |
+
|
| 262 |
+
# prepare image for attention
|
| 263 |
+
img_modulated = self.img_norm1(img)
|
| 264 |
+
img_modulated = (1 + img_mod1_scale) * img_modulated + img_mod1_shift
|
| 265 |
+
|
| 266 |
+
img_qkv = self.img_attn.qkv(img_modulated)
|
| 267 |
+
img_q, img_k, img_v = rearrange(img_qkv, "B L (K H D) -> K B H L D", K=3, H=self.num_heads)
|
| 268 |
+
img_q, img_k = self.img_attn.norm(img_q, img_k, img_v)
|
| 269 |
+
|
| 270 |
+
# prepare txt for attention
|
| 271 |
+
txt_modulated = self.txt_norm1(txt)
|
| 272 |
+
txt_modulated = (1 + txt_mod1_scale) * txt_modulated + txt_mod1_shift
|
| 273 |
+
|
| 274 |
+
txt_qkv = self.txt_attn.qkv(txt_modulated)
|
| 275 |
+
txt_q, txt_k, txt_v = rearrange(txt_qkv, "B L (K H D) -> K B H L D", K=3, H=self.num_heads)
|
| 276 |
+
txt_q, txt_k = self.txt_attn.norm(txt_q, txt_k, txt_v)
|
| 277 |
+
|
| 278 |
+
q = torch.cat((txt_q, img_q), dim=2)
|
| 279 |
+
k = torch.cat((txt_k, img_k), dim=2)
|
| 280 |
+
v = torch.cat((txt_v, img_v), dim=2)
|
| 281 |
+
|
| 282 |
+
num_txt_tokens = txt_q.shape[2]
|
| 283 |
+
pe_full = torch.cat((pe_ctx, pe), dim=2)
|
| 284 |
+
|
| 285 |
+
mods = (
|
| 286 |
+
img_mod1_gate,
|
| 287 |
+
img_mod2_shift,
|
| 288 |
+
img_mod2_scale,
|
| 289 |
+
img_mod2_gate,
|
| 290 |
+
txt_mod1_gate,
|
| 291 |
+
txt_mod2_shift,
|
| 292 |
+
txt_mod2_scale,
|
| 293 |
+
txt_mod2_gate,
|
| 294 |
+
)
|
| 295 |
+
|
| 296 |
+
return q, k, v, pe_full, num_txt_tokens, mods
|
| 297 |
+
|
| 298 |
+
def _apply_residuals(self, img, txt, img_attn, txt_attn, mods):
|
| 299 |
+
(
|
| 300 |
+
img_mod1_gate,
|
| 301 |
+
img_mod2_shift,
|
| 302 |
+
img_mod2_scale,
|
| 303 |
+
img_mod2_gate,
|
| 304 |
+
txt_mod1_gate,
|
| 305 |
+
txt_mod2_shift,
|
| 306 |
+
txt_mod2_scale,
|
| 307 |
+
txt_mod2_gate,
|
| 308 |
+
) = mods
|
| 309 |
+
|
| 310 |
+
img = img + img_mod1_gate * self.img_attn.proj(img_attn)
|
| 311 |
+
img = img + img_mod2_gate * self.img_mlp(
|
| 312 |
+
(1 + img_mod2_scale) * (self.img_norm2(img)) + img_mod2_shift
|
| 313 |
+
)
|
| 314 |
+
|
| 315 |
+
txt = txt + txt_mod1_gate * self.txt_attn.proj(txt_attn)
|
| 316 |
+
txt = txt + txt_mod2_gate * self.txt_mlp(
|
| 317 |
+
(1 + txt_mod2_scale) * (self.txt_norm2(txt)) + txt_mod2_shift
|
| 318 |
+
)
|
| 319 |
+
return img, txt
|
| 320 |
+
|
| 321 |
+
def forward_kv_extract(
|
| 322 |
+
self,
|
| 323 |
+
img: Tensor,
|
| 324 |
+
txt: Tensor,
|
| 325 |
+
pe: Tensor,
|
| 326 |
+
pe_ctx: Tensor,
|
| 327 |
+
mod_img: tuple[Tensor, Tensor],
|
| 328 |
+
mod_txt: tuple[Tensor, Tensor],
|
| 329 |
+
num_ref_tokens: int,
|
| 330 |
+
) -> tuple[Tensor, Tensor, dict]:
|
| 331 |
+
"""Forward with causal attention. img has layout [ref, img]. Extracts ref KV cache."""
|
| 332 |
+
q, k, v, pe_full, num_txt_tokens, mods = self._prepare_qkv(img, txt, pe, pe_ctx, mod_img, mod_txt)
|
| 333 |
+
q, k = apply_rope(q, k, pe_full)
|
| 334 |
+
|
| 335 |
+
ref_start = num_txt_tokens
|
| 336 |
+
ref_end = num_txt_tokens + num_ref_tokens
|
| 337 |
+
cache = {
|
| 338 |
+
"k_ref": k[:, :, ref_start:ref_end, :].clone(),
|
| 339 |
+
"v_ref": v[:, :, ref_start:ref_end, :].clone(),
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
attn = causal_attn_fn(q, k, v, num_txt_tokens, num_ref_tokens)
|
| 343 |
+
txt_attn, img_attn = attn[:, :num_txt_tokens], attn[:, num_txt_tokens:]
|
| 344 |
+
img, txt = self._apply_residuals(img, txt, img_attn, txt_attn, mods)
|
| 345 |
+
return img, txt, cache
|
| 346 |
+
|
| 347 |
+
def forward_kv_cached(
|
| 348 |
+
self,
|
| 349 |
+
img: Tensor,
|
| 350 |
+
txt: Tensor,
|
| 351 |
+
pe: Tensor,
|
| 352 |
+
pe_ctx: Tensor,
|
| 353 |
+
mod_img: tuple[Tensor, Tensor],
|
| 354 |
+
mod_txt: tuple[Tensor, Tensor],
|
| 355 |
+
kv_cache: dict,
|
| 356 |
+
) -> tuple[Tensor, Tensor]:
|
| 357 |
+
"""Forward using cached ref KV. img has layout [img] only (no ref)."""
|
| 358 |
+
q, k, v, pe_full, num_txt_tokens, mods = self._prepare_qkv(img, txt, pe, pe_ctx, mod_img, mod_txt)
|
| 359 |
+
q, k = apply_rope(q, k, pe_full)
|
| 360 |
+
|
| 361 |
+
num_ref_tokens = kv_cache["k_ref"].shape[2]
|
| 362 |
+
attn = causal_attn_fn(q, k, v, num_txt_tokens, num_ref_tokens, kv_cache)
|
| 363 |
+
txt_attn, img_attn = attn[:, :num_txt_tokens], attn[:, num_txt_tokens:]
|
| 364 |
+
return self._apply_residuals(img, txt, img_attn, txt_attn, mods)
|
| 365 |
+
|
| 366 |
+
|
| 367 |
+
class MLPEmbedder(nn.Module):
|
| 368 |
+
def __init__(self, in_dim: int, hidden_dim: int, disable_bias: bool = False):
|
| 369 |
+
super().__init__()
|
| 370 |
+
self.in_layer = nn.Linear(in_dim, hidden_dim, bias=not disable_bias)
|
| 371 |
+
self.out_layer = nn.Linear(hidden_dim, hidden_dim, bias=not disable_bias)
|
| 372 |
+
self.silu = nn.SiLU()
|
| 373 |
+
|
| 374 |
+
def forward(self, x: Tensor) -> Tensor:
|
| 375 |
+
return self.out_layer(self.silu(self.in_layer(x)))
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
class REPAEmbedder(nn.Module):
|
| 379 |
+
def __init__(self, in_dim: int, hidden_dim: int, out_dim: int, disable_bias: bool = False):
|
| 380 |
+
super().__init__()
|
| 381 |
+
self.in_layer = nn.Linear(in_dim, hidden_dim, bias=not disable_bias)
|
| 382 |
+
self.middle_layer = nn.Linear(hidden_dim, hidden_dim, bias=not disable_bias)
|
| 383 |
+
self.out_layer = nn.Linear(hidden_dim, out_dim, bias=not disable_bias)
|
| 384 |
+
self.silu = nn.SiLU()
|
| 385 |
+
|
| 386 |
+
def forward(self, x: Tensor) -> Tensor:
|
| 387 |
+
return self.out_layer(self.silu(self.middle_layer(self.silu(self.in_layer(x)))))
|
| 388 |
+
|
| 389 |
+
|
| 390 |
+
class EmbedND(nn.Module):
|
| 391 |
+
def __init__(self, dim: int, theta: int, axes_dim: list[int]):
|
| 392 |
+
super().__init__()
|
| 393 |
+
self.dim = dim
|
| 394 |
+
self.theta = theta
|
| 395 |
+
self.axes_dim = axes_dim
|
| 396 |
+
|
| 397 |
+
def forward(self, ids: Tensor) -> Tensor:
|
| 398 |
+
emb = torch.cat(
|
| 399 |
+
[rope(ids[..., i], self.axes_dim[i], self.theta) for i in range(len(self.axes_dim))],
|
| 400 |
+
dim=-3,
|
| 401 |
+
)
|
| 402 |
+
|
| 403 |
+
return emb.unsqueeze(1)
|
| 404 |
+
|
| 405 |
+
|
| 406 |
+
def timestep_embedding(t: Tensor, dim, max_period=10000, time_factor: float = 1000.0):
|
| 407 |
+
"""
|
| 408 |
+
Create sinusoidal timestep embeddings.
|
| 409 |
+
:param t: a 1-D Tensor of N indices, one per batch element.
|
| 410 |
+
These may be fractional.
|
| 411 |
+
:param dim: the dimension of the output.
|
| 412 |
+
:param max_period: controls the minimum frequency of the embeddings.
|
| 413 |
+
:return: an (N, D) Tensor of positional embeddings.
|
| 414 |
+
"""
|
| 415 |
+
t = time_factor * t
|
| 416 |
+
half = dim // 2
|
| 417 |
+
freqs = torch.exp(
|
| 418 |
+
-math.log(max_period) * torch.arange(start=0, end=half, device=t.device, dtype=torch.float32) / half
|
| 419 |
+
)
|
| 420 |
+
|
| 421 |
+
args = t[:, None].float() * freqs[None]
|
| 422 |
+
embedding = torch.cat([torch.cos(args), torch.sin(args)], dim=-1)
|
| 423 |
+
if dim % 2:
|
| 424 |
+
embedding = torch.cat([embedding, torch.zeros_like(embedding[:, :1])], dim=-1)
|
| 425 |
+
if torch.is_floating_point(t):
|
| 426 |
+
embedding = embedding.to(t)
|
| 427 |
+
return embedding
|
| 428 |
+
|
| 429 |
+
|
| 430 |
+
class RMSNorm(torch.nn.Module):
|
| 431 |
+
def __init__(self, dim: int):
|
| 432 |
+
super().__init__()
|
| 433 |
+
self.scale = nn.Parameter(torch.ones(dim))
|
| 434 |
+
|
| 435 |
+
def forward(self, x: Tensor):
|
| 436 |
+
x_dtype = x.dtype
|
| 437 |
+
x = x.float()
|
| 438 |
+
rrms = torch.rsqrt(torch.mean(x**2, dim=-1, keepdim=True) + 1e-6)
|
| 439 |
+
return (x * rrms).to(dtype=x_dtype) * self.scale
|
| 440 |
+
|
| 441 |
+
|
| 442 |
+
class QKNorm(torch.nn.Module):
|
| 443 |
+
def __init__(self, dim: int):
|
| 444 |
+
super().__init__()
|
| 445 |
+
self.query_norm = RMSNorm(dim)
|
| 446 |
+
self.key_norm = RMSNorm(dim)
|
| 447 |
+
|
| 448 |
+
def forward(self, q: Tensor, k: Tensor, v: Tensor) -> tuple[Tensor, Tensor]:
|
| 449 |
+
q = self.query_norm(q)
|
| 450 |
+
k = self.key_norm(k)
|
| 451 |
+
return q.to(v), k.to(v)
|
| 452 |
+
|
| 453 |
+
|
| 454 |
+
def causal_attn_fn(
|
| 455 |
+
q: Tensor,
|
| 456 |
+
k: Tensor,
|
| 457 |
+
v: Tensor,
|
| 458 |
+
num_txt_tokens: int,
|
| 459 |
+
num_ref_tokens: int,
|
| 460 |
+
kv_cache: dict | None = None,
|
| 461 |
+
) -> Tensor:
|
| 462 |
+
"""
|
| 463 |
+
Causal attention where reference tokens only attend to themselves.
|
| 464 |
+
|
| 465 |
+
Without cache: layout is [txt, ref, img]. txt+img attend to all, ref self-attends.
|
| 466 |
+
With cache: layout is [txt, img]. Cached ref K/V injected into attention.
|
| 467 |
+
"""
|
| 468 |
+
if kv_cache is not None:
|
| 469 |
+
k_ref = kv_cache["k_ref"]
|
| 470 |
+
v_ref = kv_cache["v_ref"]
|
| 471 |
+
|
| 472 |
+
q_txt = q[:, :, :num_txt_tokens, :]
|
| 473 |
+
q_img = q[:, :, num_txt_tokens:, :]
|
| 474 |
+
k_txt = k[:, :, :num_txt_tokens, :]
|
| 475 |
+
v_txt = v[:, :, :num_txt_tokens, :]
|
| 476 |
+
k_img = k[:, :, num_txt_tokens:, :]
|
| 477 |
+
v_img = v[:, :, num_txt_tokens:, :]
|
| 478 |
+
|
| 479 |
+
q_txt_img = torch.cat([q_txt, q_img], dim=2)
|
| 480 |
+
k_all = torch.cat([k_txt, k_ref, k_img], dim=2)
|
| 481 |
+
v_all = torch.cat([v_txt, v_ref, v_img], dim=2)
|
| 482 |
+
out = F.scaled_dot_product_attention(q_txt_img, k_all, v_all, is_causal=False)
|
| 483 |
+
|
| 484 |
+
else:
|
| 485 |
+
ref_start = num_txt_tokens
|
| 486 |
+
ref_end = num_txt_tokens + num_ref_tokens
|
| 487 |
+
|
| 488 |
+
q_txt = q[:, :, :ref_start, :]
|
| 489 |
+
q_ref = q[:, :, ref_start:ref_end, :]
|
| 490 |
+
q_img = q[:, :, ref_end:, :]
|
| 491 |
+
k_txt = k[:, :, :ref_start, :]
|
| 492 |
+
v_txt = v[:, :, :ref_start, :]
|
| 493 |
+
k_ref = k[:, :, ref_start:ref_end, :]
|
| 494 |
+
v_ref = v[:, :, ref_start:ref_end, :]
|
| 495 |
+
k_img = k[:, :, ref_end:, :]
|
| 496 |
+
v_img = v[:, :, ref_end:, :]
|
| 497 |
+
|
| 498 |
+
# txt+img attend to all keys
|
| 499 |
+
q_txt_img = torch.cat([q_txt, q_img], dim=2)
|
| 500 |
+
k_all = torch.cat([k_txt, k_ref, k_img], dim=2)
|
| 501 |
+
v_all = torch.cat([v_txt, v_ref, v_img], dim=2)
|
| 502 |
+
attn_txt_img = F.scaled_dot_product_attention(q_txt_img, k_all, v_all, is_causal=False)
|
| 503 |
+
attn_txt = attn_txt_img[:, :, :ref_start, :]
|
| 504 |
+
attn_img = attn_txt_img[:, :, ref_start:, :]
|
| 505 |
+
|
| 506 |
+
# ref only attends to itself
|
| 507 |
+
attn_ref = F.scaled_dot_product_attention(q_ref, k_ref, v_ref, is_causal=False)
|
| 508 |
+
|
| 509 |
+
out = torch.cat([attn_txt, attn_ref, attn_img], dim=2)
|
| 510 |
+
|
| 511 |
+
return rearrange(out, "b h n d -> b n (h d)")
|
| 512 |
+
|
| 513 |
+
|
| 514 |
+
def rope(pos: Tensor, dim: int, theta: int) -> Tensor:
|
| 515 |
+
assert dim % 2 == 0
|
| 516 |
+
scale = torch.arange(0, dim, 2, dtype=pos.dtype, device=pos.device) / dim
|
| 517 |
+
omega = 1.0 / (theta**scale)
|
| 518 |
+
out = torch.einsum("...n,d->...nd", pos, omega)
|
| 519 |
+
out = torch.stack([torch.cos(out), -torch.sin(out), torch.sin(out), torch.cos(out)], dim=-1)
|
| 520 |
+
out = rearrange(out, "b n d (i j) -> b n d i j", i=2, j=2)
|
| 521 |
+
return out.float()
|
| 522 |
+
|
| 523 |
+
|
| 524 |
+
def apply_rope(xq: Tensor, xk: Tensor, freqs_cis: Tensor) -> tuple[Tensor, Tensor]:
|
| 525 |
+
xq_ = xq.float().reshape(*xq.shape[:-1], -1, 1, 2)
|
| 526 |
+
xk_ = xk.float().reshape(*xk.shape[:-1], -1, 1, 2)
|
| 527 |
+
xq_out = freqs_cis[..., 0] * xq_[..., 0] + freqs_cis[..., 1] * xq_[..., 1]
|
| 528 |
+
xk_out = freqs_cis[..., 0] * xk_[..., 0] + freqs_cis[..., 1] * xk_[..., 1]
|
| 529 |
+
return xq_out.reshape(*xq.shape).type_as(xq), xk_out.reshape(*xk.shape).type_as(xk)
|
| 530 |
+
|
| 531 |
+
|
| 532 |
+
class GeoCoreTransformer2DModel(ModelMixin, ConfigMixin):
|
| 533 |
+
r"""GeoCore text- and geo-conditioned Flow Matching DiT.
|
| 534 |
+
|
| 535 |
+
Self-contained FLUX.2-style double/single-stream transformer with geospatial
|
| 536 |
+
metadata conditioning (`res`, `lon`, `lat`) and an optional GSA projection head.
|
| 537 |
+
"""
|
| 538 |
+
|
| 539 |
+
config_name = "config.json"
|
| 540 |
+
_supports_gradient_checkpointing = True
|
| 541 |
+
_no_split_modules = ["DoubleStreamBlock", "SingleStreamBlock"]
|
| 542 |
+
_repeated_blocks = ["DoubleStreamBlock", "SingleStreamBlock"]
|
| 543 |
+
|
| 544 |
+
@register_to_config
|
| 545 |
+
def __init__(
|
| 546 |
+
self,
|
| 547 |
+
in_channels: int = 128,
|
| 548 |
+
context_in_dim: int = 4096,
|
| 549 |
+
hidden_size: int = 4096,
|
| 550 |
+
num_heads: int = 32,
|
| 551 |
+
depth: int = 8,
|
| 552 |
+
depth_repa: int = 8,
|
| 553 |
+
depth_single_blocks: int = 24,
|
| 554 |
+
axes_dim: list[int] | None = None,
|
| 555 |
+
theta: int = 2000,
|
| 556 |
+
mlp_ratio: float = 3.0,
|
| 557 |
+
y_in_dim: int = 768,
|
| 558 |
+
z_out_dim: int = 4096,
|
| 559 |
+
model_size: str = "9b",
|
| 560 |
+
sample_size: int = 16,
|
| 561 |
+
patch_size: int = 2,
|
| 562 |
+
latent_channels: int = 128,
|
| 563 |
+
weights: str = "model",
|
| 564 |
+
training_steps: int | None = None,
|
| 565 |
+
**_unused: Any,
|
| 566 |
+
) -> None:
|
| 567 |
+
super().__init__()
|
| 568 |
+
axes_dim = list(axes_dim) if axes_dim is not None else [32, 48, 48]
|
| 569 |
+
|
| 570 |
+
self.gradient_checkpointing = False
|
| 571 |
+
self.in_channels = in_channels
|
| 572 |
+
self.out_channels = in_channels
|
| 573 |
+
self.depth_repa = depth_repa
|
| 574 |
+
if hidden_size % num_heads != 0:
|
| 575 |
+
raise ValueError(
|
| 576 |
+
f"Hidden size {hidden_size} must be divisible by num_heads {num_heads}"
|
| 577 |
+
)
|
| 578 |
+
pe_dim = hidden_size // num_heads
|
| 579 |
+
if sum(axes_dim) != pe_dim:
|
| 580 |
+
raise ValueError(f"Got {axes_dim} but expected positional dim {pe_dim}")
|
| 581 |
+
self.hidden_size = hidden_size
|
| 582 |
+
self.num_heads = num_heads
|
| 583 |
+
self.pe_embedder = EmbedND(dim=pe_dim, theta=theta, axes_dim=axes_dim)
|
| 584 |
+
self.img_in = nn.Linear(self.in_channels, self.hidden_size, bias=False)
|
| 585 |
+
self.txt_in = nn.Linear(context_in_dim, self.hidden_size, bias=False)
|
| 586 |
+
self.y_in = nn.Linear(y_in_dim, self.hidden_size, bias=False)
|
| 587 |
+
self.time_in = MLPEmbedder(in_dim=256, hidden_dim=self.hidden_size, disable_bias=True)
|
| 588 |
+
self.res_in = MLPEmbedder(in_dim=256, hidden_dim=self.hidden_size, disable_bias=True)
|
| 589 |
+
self.lon_in = MLPEmbedder(in_dim=256, hidden_dim=self.hidden_size, disable_bias=True)
|
| 590 |
+
self.lat_in = MLPEmbedder(in_dim=256, hidden_dim=self.hidden_size, disable_bias=True)
|
| 591 |
+
self.repa_out = REPAEmbedder(
|
| 592 |
+
in_dim=self.hidden_size,
|
| 593 |
+
hidden_dim=2 * self.hidden_size,
|
| 594 |
+
out_dim=z_out_dim,
|
| 595 |
+
disable_bias=True,
|
| 596 |
+
)
|
| 597 |
+
|
| 598 |
+
self.null_res_emb = nn.Parameter(torch.zeros(1, 256))
|
| 599 |
+
self.null_lon_emb = nn.Parameter(torch.zeros(1, 256))
|
| 600 |
+
self.null_lat_emb = nn.Parameter(torch.zeros(1, 256))
|
| 601 |
+
|
| 602 |
+
self.double_blocks = nn.ModuleList(
|
| 603 |
+
[
|
| 604 |
+
DoubleStreamBlock(self.hidden_size, self.num_heads, mlp_ratio=mlp_ratio)
|
| 605 |
+
for _ in range(depth)
|
| 606 |
+
]
|
| 607 |
+
)
|
| 608 |
+
self.single_blocks = nn.ModuleList(
|
| 609 |
+
[
|
| 610 |
+
SingleStreamBlock(self.hidden_size, self.num_heads, mlp_ratio=mlp_ratio)
|
| 611 |
+
for _ in range(depth_single_blocks)
|
| 612 |
+
]
|
| 613 |
+
)
|
| 614 |
+
|
| 615 |
+
self.double_stream_modulation_img = Modulation(self.hidden_size, double=True, disable_bias=True)
|
| 616 |
+
self.double_stream_modulation_txt = Modulation(self.hidden_size, double=True, disable_bias=True)
|
| 617 |
+
self.single_stream_modulation = Modulation(self.hidden_size, double=False, disable_bias=True)
|
| 618 |
+
self.final_layer = LastLayer(self.hidden_size, self.out_channels)
|
| 619 |
+
# Skip init under accelerate.init_empty_weights() (meta tensors) used by device_map.
|
| 620 |
+
first = next(self.parameters(), None)
|
| 621 |
+
if first is not None and first.device.type != "meta":
|
| 622 |
+
self.initialize_weights()
|
| 623 |
+
|
| 624 |
+
def _set_gradient_checkpointing(self, module, value: bool = False) -> None:
|
| 625 |
+
if hasattr(module, "gradient_checkpointing"):
|
| 626 |
+
module.gradient_checkpointing = value
|
| 627 |
+
self.gradient_checkpointing = value
|
| 628 |
+
|
| 629 |
+
def initialize_weights(self):
|
| 630 |
+
|
| 631 |
+
def _basic_init(module):
|
| 632 |
+
if isinstance(module, nn.Linear):
|
| 633 |
+
torch.nn.init.xavier_uniform_(module.weight)
|
| 634 |
+
if module.bias is not None:
|
| 635 |
+
nn.init.constant_(module.bias, 0)
|
| 636 |
+
|
| 637 |
+
self.apply(_basic_init)
|
| 638 |
+
|
| 639 |
+
nn.init.normal_(self.img_in.weight, std=0.02)
|
| 640 |
+
nn.init.normal_(self.txt_in.weight, std=0.02)
|
| 641 |
+
nn.init.normal_(self.y_in.weight, std=0.02)
|
| 642 |
+
|
| 643 |
+
for embedder in [self.time_in, self.res_in, self.lon_in, self.lat_in]:
|
| 644 |
+
nn.init.normal_(embedder.in_layer.weight, std=0.02)
|
| 645 |
+
nn.init.constant_(embedder.out_layer.weight, 0)
|
| 646 |
+
if embedder.out_layer.bias is not None:
|
| 647 |
+
nn.init.constant_(embedder.out_layer.bias, 0)
|
| 648 |
+
|
| 649 |
+
nn.init.constant_(self.double_stream_modulation_img.lin.weight, 0)
|
| 650 |
+
nn.init.constant_(self.double_stream_modulation_txt.lin.weight, 0)
|
| 651 |
+
nn.init.constant_(self.single_stream_modulation.lin.weight, 0)
|
| 652 |
+
|
| 653 |
+
if self.single_stream_modulation.lin.bias is not None:
|
| 654 |
+
nn.init.constant_(self.single_stream_modulation.lin.bias, 0)
|
| 655 |
+
|
| 656 |
+
nn.init.constant_(self.final_layer.adaLN_modulation[1].weight, 0)
|
| 657 |
+
if self.final_layer.adaLN_modulation[1].bias is not None:
|
| 658 |
+
nn.init.constant_(self.final_layer.adaLN_modulation[1].bias, 0)
|
| 659 |
+
|
| 660 |
+
nn.init.constant_(self.final_layer.linear.weight, 0)
|
| 661 |
+
if self.final_layer.linear.bias is not None:
|
| 662 |
+
nn.init.constant_(self.final_layer.linear.bias, 0)
|
| 663 |
+
|
| 664 |
+
nn.init.constant_(self.repa_out.out_layer.weight, 0)
|
| 665 |
+
if self.repa_out.out_layer.bias is not None:
|
| 666 |
+
nn.init.constant_(self.repa_out.out_layer.bias, 0)
|
| 667 |
+
|
| 668 |
+
nn.init.normal_(self.null_res_emb, std=0.02)
|
| 669 |
+
nn.init.normal_(self.null_lon_emb, std=0.02)
|
| 670 |
+
nn.init.normal_(self.null_lat_emb, std=0.02)
|
| 671 |
+
|
| 672 |
+
|
| 673 |
+
def make_vec(self, timesteps, res, lon, lat, y):
|
| 674 |
+
drop_res_mask = (res == -999.0).view(-1, 1)
|
| 675 |
+
drop_loc_mask = (lon == -999.0).view(-1, 1)
|
| 676 |
+
|
| 677 |
+
res_norm = (res - (-1.0)) / 8.0
|
| 678 |
+
lon_norm = (lon - (-180.0)) / 360.0
|
| 679 |
+
lat_norm = (lat - (-90.0)) / 180.0
|
| 680 |
+
|
| 681 |
+
t_emb = timestep_embedding(timesteps, 256)
|
| 682 |
+
res_emb_raw = timestep_embedding(res_norm, 256)
|
| 683 |
+
lon_emb_raw = timestep_embedding(lon_norm, 256)
|
| 684 |
+
lat_emb_raw = timestep_embedding(lat_norm, 256)
|
| 685 |
+
|
| 686 |
+
res_emb = torch.where(drop_res_mask, self.null_res_emb.to(res_emb_raw.dtype), res_emb_raw)
|
| 687 |
+
lon_emb = torch.where(drop_loc_mask, self.null_lon_emb.to(lon_emb_raw.dtype), lon_emb_raw)
|
| 688 |
+
lat_emb = torch.where(drop_loc_mask, self.null_lat_emb.to(lat_emb_raw.dtype), lat_emb_raw)
|
| 689 |
+
|
| 690 |
+
return self.time_in(t_emb) + self.res_in(res_emb) + self.lon_in(lon_emb) + self.lat_in(lat_emb) + self.y_in(y)
|
| 691 |
+
|
| 692 |
+
def forward(
|
| 693 |
+
self,
|
| 694 |
+
x: Tensor,
|
| 695 |
+
x_ids: Tensor,
|
| 696 |
+
timesteps: Tensor,
|
| 697 |
+
ctx: Tensor,
|
| 698 |
+
ctx_ids: Tensor,
|
| 699 |
+
y: Tensor,
|
| 700 |
+
res: Tensor,
|
| 701 |
+
lon: Tensor,
|
| 702 |
+
lat: Tensor,
|
| 703 |
+
detach: bool = False,
|
| 704 |
+
):
|
| 705 |
+
B, C, H_lat, W_lat = x.shape
|
| 706 |
+
x = x.flatten(2).transpose(1, 2)
|
| 707 |
+
|
| 708 |
+
num_txt_tokens = ctx.shape[1]
|
| 709 |
+
|
| 710 |
+
vec = self.make_vec(timesteps, res, lon, lat, y)
|
| 711 |
+
|
| 712 |
+
double_block_mod_img = self.double_stream_modulation_img(vec)
|
| 713 |
+
double_block_mod_txt = self.double_stream_modulation_txt(vec)
|
| 714 |
+
single_block_mod, _ = self.single_stream_modulation(vec)
|
| 715 |
+
|
| 716 |
+
img = self.img_in(x)
|
| 717 |
+
txt = self.txt_in(ctx)
|
| 718 |
+
|
| 719 |
+
pe_x = self.pe_embedder(x_ids)
|
| 720 |
+
pe_ctx = self.pe_embedder(ctx_ids)
|
| 721 |
+
|
| 722 |
+
z_repa = None
|
| 723 |
+
for i, block in enumerate(self.double_blocks):
|
| 724 |
+
if self.gradient_checkpointing and self.training:
|
| 725 |
+
img, txt, _ = checkpoint(
|
| 726 |
+
block.forward_kv_extract,
|
| 727 |
+
img, txt, pe_x, pe_ctx,
|
| 728 |
+
double_block_mod_img, double_block_mod_txt,
|
| 729 |
+
0, # num_ref_tokens
|
| 730 |
+
use_reentrant=False
|
| 731 |
+
)
|
| 732 |
+
else:
|
| 733 |
+
img, txt, _ = block(
|
| 734 |
+
img, txt, pe_x, pe_ctx,
|
| 735 |
+
double_block_mod_img, double_block_mod_txt,
|
| 736 |
+
0,
|
| 737 |
+
)
|
| 738 |
+
|
| 739 |
+
if (i + 1) == self.depth_repa:
|
| 740 |
+
curr_x = img.detach() if detach else img
|
| 741 |
+
z_repa = self.repa_out(curr_x)
|
| 742 |
+
|
| 743 |
+
img = torch.cat((txt, img), dim=1)
|
| 744 |
+
pe = torch.cat((pe_ctx, pe_x), dim=2)
|
| 745 |
+
|
| 746 |
+
for block in self.single_blocks:
|
| 747 |
+
if self.gradient_checkpointing and self.training:
|
| 748 |
+
img, _ = checkpoint(
|
| 749 |
+
block.forward_kv_extract,
|
| 750 |
+
img, pe, single_block_mod,
|
| 751 |
+
num_txt_tokens,
|
| 752 |
+
0, # num_ref_tokens
|
| 753 |
+
use_reentrant=False
|
| 754 |
+
)
|
| 755 |
+
else:
|
| 756 |
+
img, _ = block(
|
| 757 |
+
img, pe, single_block_mod,
|
| 758 |
+
num_txt_tokens,
|
| 759 |
+
0,
|
| 760 |
+
)
|
| 761 |
+
|
| 762 |
+
img = img[:, num_txt_tokens:, ...]
|
| 763 |
+
|
| 764 |
+
img = self.final_layer(img, vec)
|
| 765 |
+
img = img.transpose(1, 2).reshape(B, -1, H_lat, W_lat)
|
| 766 |
+
return img, z_repa
|
| 767 |
+
|
vae/config.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "AutoencoderKLFlux2",
|
| 3 |
+
"_diffusers_version": "0.37.0.dev0",
|
| 4 |
+
"_name_or_path": "black-forest-labs/FLUX.2-dev",
|
| 5 |
+
"act_fn": "silu",
|
| 6 |
+
"batch_norm_eps": 0.0001,
|
| 7 |
+
"batch_norm_momentum": 0.1,
|
| 8 |
+
"block_out_channels": [
|
| 9 |
+
128,
|
| 10 |
+
256,
|
| 11 |
+
512,
|
| 12 |
+
512
|
| 13 |
+
],
|
| 14 |
+
"down_block_types": [
|
| 15 |
+
"DownEncoderBlock2D",
|
| 16 |
+
"DownEncoderBlock2D",
|
| 17 |
+
"DownEncoderBlock2D",
|
| 18 |
+
"DownEncoderBlock2D"
|
| 19 |
+
],
|
| 20 |
+
"force_upcast": true,
|
| 21 |
+
"in_channels": 3,
|
| 22 |
+
"latent_channels": 32,
|
| 23 |
+
"layers_per_block": 2,
|
| 24 |
+
"mid_block_add_attention": true,
|
| 25 |
+
"norm_num_groups": 32,
|
| 26 |
+
"out_channels": 3,
|
| 27 |
+
"patch_size": [
|
| 28 |
+
2,
|
| 29 |
+
2
|
| 30 |
+
],
|
| 31 |
+
"sample_size": 1024,
|
| 32 |
+
"up_block_types": [
|
| 33 |
+
"UpDecoderBlock2D",
|
| 34 |
+
"UpDecoderBlock2D",
|
| 35 |
+
"UpDecoderBlock2D",
|
| 36 |
+
"UpDecoderBlock2D"
|
| 37 |
+
],
|
| 38 |
+
"use_post_quant_conv": true,
|
| 39 |
+
"use_quant_conv": true
|
| 40 |
+
}
|
vae/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca70d2202afe6415bdbcb8793ba8cd99fd159cfe6192381504d6c4d3036e0f04
|
| 3 |
+
size 168120878
|