Text Classification
Transformers
Safetensors
PEFT
branchone
feature-extraction
decision-model
multimodal
custom-code
custom_code
Instructions to use ndemirdemir/BranchOne with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ndemirdemir/BranchOne with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ndemirdemir/BranchOne", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ndemirdemir/BranchOne", trust_remote_code=True, device_map="auto") - PEFT
How to use ndemirdemir/BranchOne with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Release BranchOne FP16 text and image decision model
Browse filesApache-2.0 inference package with trained adapters, shared scorer, processor, calibrated probabilities, and standalone usage examples.
- .gitattributes +1 -0
- LICENSE +202 -0
- NOTICE +10 -0
- README.md +170 -0
- adapter/adapter_config.json +56 -0
- adapter/adapter_model.safetensors +3 -0
- build_causal_conv.py +94 -0
- calibration.json +25 -0
- calibration.py +126 -0
- config.json +11 -0
- configuration_branchone.py +13 -0
- cuda_toolchain.py +56 -0
- head.py +55 -0
- head.safetensors +3 -0
- install.py +33 -0
- io.py +9 -0
- model.py +507 -0
- model_config.json +13 -0
- modeling_branchone.py +105 -0
- processor/chat_template.jinja +154 -0
- processor/processor_config.json +61 -0
- processor/tokenizer.json +3 -0
- processor/tokenizer_config.json +33 -0
- pyproject.toml +36 -0
- schema.py +45 -0
- uv.lock +788 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
processor/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright 2026 Alibaba Cloud
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
NOTICE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
BranchOne
|
| 2 |
+
|
| 3 |
+
This BranchOne release is licensed under the Apache License, Version 2.0.
|
| 4 |
+
It builds on Qwen/Qwen3.5-0.8B-Base, Copyright 2026 Alibaba Cloud,
|
| 5 |
+
also licensed under Apache-2.0. Original upstream attribution is retained
|
| 6 |
+
in LICENSE. The pinned backbone is downloaded separately.
|
| 7 |
+
|
| 8 |
+
BranchOne adds trained low-rank adapters, an independent candidate scoring
|
| 9 |
+
head, calibration, and inference code. The backbone reference is
|
| 10 |
+
dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68.
|
README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
base_model: Qwen/Qwen3.5-0.8B-Base
|
| 5 |
+
base_model_relation: adapter
|
| 6 |
+
tags:
|
| 7 |
+
- branchone
|
| 8 |
+
- decision-model
|
| 9 |
+
- multimodal
|
| 10 |
+
- text-classification
|
| 11 |
+
- custom-code
|
| 12 |
+
- peft
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# BranchOne
|
| 16 |
+
|
| 17 |
+
BranchOne chooses among candidate descriptions supplied with each request. Give
|
| 18 |
+
it a situation, a question, and two or more choices, optionally with one image.
|
| 19 |
+
It returns one probability per choice and the selected candidate's ID.
|
| 20 |
+
|
| 21 |
+
This release contains trained LoRA adapters, a shared decision head, a processor,
|
| 22 |
+
calibration, and the inference code. The loader downloads the pinned public
|
| 23 |
+
Qwen3.5-0.8B-Base backbone separately on first use. No reproduction repository,
|
| 24 |
+
training scripts, or GitHub access is required.
|
| 25 |
+
|
| 26 |
+
## Install
|
| 27 |
+
|
| 28 |
+
The supported setup is Linux x86-64, Python 3.13, and an NVIDIA CUDA GPU.
|
| 29 |
+
The reference environment uses an A100, PyTorch 2.11.0 with CUDA 12.8,
|
| 30 |
+
Transformers 5.17.0, and FP16 backbone weights. The head computes in FP32.
|
| 31 |
+
CPU inference, other precisions, and quantization are not qualified for this
|
| 32 |
+
release. Leave several GB of GPU memory available; requirements increase with
|
| 33 |
+
input length. A maximum-memory benchmark is not provided.
|
| 34 |
+
|
| 35 |
+
On a fresh Colab GPU runtime or a Linux CUDA machine:
|
| 36 |
+
|
| 37 |
+
```bash
|
| 38 |
+
python3 -m pip install uv==0.12.17
|
| 39 |
+
python3 -m uv tool run --from huggingface-hub==1.33.0 hf download ndemirdemir/BranchOne --local-dir BranchOne
|
| 40 |
+
python3 BranchOne/install.py --venv .venv
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
The installer creates an isolated environment, installs the locked dependencies,
|
| 44 |
+
and compiles `causal-conv1d==1.7.0`. It needs CUDA 12.8 development tools. On
|
| 45 |
+
Colab it can install those tools through the configured NVIDIA apt repository;
|
| 46 |
+
on a machine without root access, install the toolkit first and set `CUDA_HOME`.
|
| 47 |
+
The initial dependency installation and kernel build can take several minutes.
|
| 48 |
+
Run the examples below with `.venv/bin/python`, or select that environment in
|
| 49 |
+
your notebook. These setup scripts install inference dependencies only.
|
| 50 |
+
|
| 51 |
+
## Text example
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
import os
|
| 55 |
+
from transformers import AutoModel
|
| 56 |
+
|
| 57 |
+
# Defaults to the Hub. A downloaded directory works with the same interface.
|
| 58 |
+
model = AutoModel.from_pretrained(
|
| 59 |
+
os.environ.get("BRANCHONE_MODEL", "ndemirdemir/BranchOne"),
|
| 60 |
+
trust_remote_code=True,
|
| 61 |
+
device="cuda",
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
result = model.predict({
|
| 65 |
+
"state": "The parcel arrived, but the item inside is broken.",
|
| 66 |
+
"question": "What should happen next?",
|
| 67 |
+
"candidates": [
|
| 68 |
+
{"id": "replace", "description": "Arrange a replacement for the damaged item."},
|
| 69 |
+
{"id": "track", "description": "Track the parcel because it has not arrived."},
|
| 70 |
+
],
|
| 71 |
+
})
|
| 72 |
+
print(result["selected_id"])
|
| 73 |
+
print(dict(zip(result["candidate_ids"], result["probabilities"])))
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
`trust_remote_code=True` loads the BranchOne inference implementation included
|
| 77 |
+
in this model repository. For reproducible deployments, add
|
| 78 |
+
`revision="<release commit SHA>"` once a release is published. To use the directory
|
| 79 |
+
downloaded above, set `BRANCHONE_MODEL=./BranchOne`. Both the model package and the
|
| 80 |
+
base model must already be cached when using `local_files_only=True`.
|
| 81 |
+
|
| 82 |
+
## Image example
|
| 83 |
+
|
| 84 |
+
Use the same loaded `model`. This complete example creates a sample picture;
|
| 85 |
+
replace `picture` with a PIL image or a local image path for your own input.
|
| 86 |
+
|
| 87 |
+
```python
|
| 88 |
+
from PIL import Image, ImageDraw
|
| 89 |
+
|
| 90 |
+
picture = Image.new("RGB", (512, 512), "white")
|
| 91 |
+
ImageDraw.Draw(picture).ellipse((128, 128, 384, 384), fill="blue")
|
| 92 |
+
image_result = model.predict({
|
| 93 |
+
"state": "Look at the supplied image.",
|
| 94 |
+
"question": "Which shape is shown?",
|
| 95 |
+
"image": picture,
|
| 96 |
+
"candidates": [
|
| 97 |
+
{"id": "circle", "description": "A circle."},
|
| 98 |
+
{"id": "square", "description": "A square."},
|
| 99 |
+
{"id": "triangle", "description": "A triangle."},
|
| 100 |
+
],
|
| 101 |
+
})
|
| 102 |
+
print(image_result["selected_id"])
|
| 103 |
+
print(dict(zip(image_result["candidate_ids"], image_result["probabilities"])))
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
## Inputs and outputs
|
| 107 |
+
|
| 108 |
+
- `state`: situation or evidence as text.
|
| 109 |
+
- `question`: the decision to make.
|
| 110 |
+
- `candidates`: 2–150 unique string IDs with nonempty text descriptions. IDs are
|
| 111 |
+
external labels; the model reads the descriptions. This is an input guard,
|
| 112 |
+
not a claim of equal quality or speed at all candidate counts.
|
| 113 |
+
- `image`: optional single PIL image or local path. Image URLs, multiple images,
|
| 114 |
+
video, and audio are unsupported.
|
| 115 |
+
|
| 116 |
+
The limit is **8,192 expanded tokens per candidate branch**, including the
|
| 117 |
+
situation, question, prompt formatting, that candidate's description, and image
|
| 118 |
+
tokens. Images are resized to a budget of at most 256 visual tokens. Oversized
|
| 119 |
+
inputs raise an error; they are not silently truncated. Increasing the context
|
| 120 |
+
setting is not a supported extension of this trained release.
|
| 121 |
+
|
| 122 |
+
`predict()` returns `selected_id`, input-aligned `candidate_ids`, `probabilities`,
|
| 123 |
+
raw `logits`, `temperature`, token counts, and calibration/policy metadata.
|
| 124 |
+
The probability distribution is conditional on the supplied choices. It does
|
| 125 |
+
not establish that a correct choice is present.
|
| 126 |
+
|
| 127 |
+
By default, `action` is `"defer"` and `deferral_status` is `"no validated policy"`:
|
| 128 |
+
the release has no validated automatic-acceptance threshold. The predicted
|
| 129 |
+
candidate and probabilities are still returned. An optional caller-supplied
|
| 130 |
+
`threshold` changes the action rule; callers must validate their own threshold.
|
| 131 |
+
|
| 132 |
+
## Architecture and training
|
| 133 |
+
|
| 134 |
+
Each candidate is encoded against the same evidence on an independent Qwen
|
| 135 |
+
branch. A shared head maps each 1,024-wide candidate representation through a
|
| 136 |
+
256-wide projection and residual MLP to one scalar. Softmax over the scores,
|
| 137 |
+
with the supplied temperature, gives the candidate probabilities. This
|
| 138 |
+
checkpoint uses the independent scorer without a candidate-comparison layer.
|
| 139 |
+
|
| 140 |
+
The vision backbone is frozen. The text backbone has trained rank-8 LoRA
|
| 141 |
+
adapters; the decision head is trained. The vocabulary generation head is not
|
| 142 |
+
used. Prefix-cache reuse is disabled for this release. Additional candidates
|
| 143 |
+
and longer inputs still require additional computation.
|
| 144 |
+
|
| 145 |
+
Training used supervised single-label choice examples from procedural synthetic
|
| 146 |
+
text and rendered images. The checkpoint was selected using development loss;
|
| 147 |
+
temperature scaling was fitted on a separate calibration split. This release
|
| 148 |
+
does not establish general-purpose decision accuracy, natural-image competence,
|
| 149 |
+
or calibrated probabilities on a new domain. Boolean and ordered-score quality
|
| 150 |
+
have not been separately validated.
|
| 151 |
+
|
| 152 |
+
## Limitations
|
| 153 |
+
|
| 154 |
+
Evaluate on representative data before deploying. Missing evidence, ambiguous
|
| 155 |
+
choices, unsupported image content, and distribution shifts can produce wrong
|
| 156 |
+
answers with high confidence. Temperature scaling does not guarantee that a
|
| 157 |
+
particular prediction is correct. Duplicate descriptions share evidence and
|
| 158 |
+
can change the probability distribution.
|
| 159 |
+
|
| 160 |
+
This is an experimental inference release. It does not claim sub-second
|
| 161 |
+
latency for the trained checkpoint, fast long-context CPU inference, or
|
| 162 |
+
superiority to other decision models. The package is intended for
|
| 163 |
+
`AutoModel.from_pretrained(...).predict(...)`; standard generation pipelines,
|
| 164 |
+
hosted inference-provider support, and `save_pretrained()` are not provided.
|
| 165 |
+
|
| 166 |
+
## License
|
| 167 |
+
|
| 168 |
+
Apache-2.0. See `LICENSE` and `NOTICE`. The pinned Qwen backbone is
|
| 169 |
+
`Qwen/Qwen3.5-0.8B-Base` at revision
|
| 170 |
+
`dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68` and retains its upstream attribution.
|
adapter/adapter_config.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "Qwen/Qwen3.5-0.8B-Base",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": false,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"kasa_config": null,
|
| 16 |
+
"layer_replication": null,
|
| 17 |
+
"layers_pattern": null,
|
| 18 |
+
"layers_to_transform": null,
|
| 19 |
+
"loftq_config": {},
|
| 20 |
+
"lora_alpha": 16,
|
| 21 |
+
"lora_bias": false,
|
| 22 |
+
"lora_dropout": 0.05,
|
| 23 |
+
"lora_ga_config": null,
|
| 24 |
+
"megatron_config": null,
|
| 25 |
+
"megatron_core": "megatron.core",
|
| 26 |
+
"modules_to_save": null,
|
| 27 |
+
"monteclora_config": null,
|
| 28 |
+
"peft_type": "LORA",
|
| 29 |
+
"peft_version": "0.21.0",
|
| 30 |
+
"qalora_group_size": 16,
|
| 31 |
+
"r": 8,
|
| 32 |
+
"rank_pattern": {},
|
| 33 |
+
"revision": null,
|
| 34 |
+
"target_modules": [
|
| 35 |
+
"q_proj",
|
| 36 |
+
"in_proj_a",
|
| 37 |
+
"out_proj",
|
| 38 |
+
"o_proj",
|
| 39 |
+
"down_proj",
|
| 40 |
+
"in_proj_b",
|
| 41 |
+
"in_proj_z",
|
| 42 |
+
"up_proj",
|
| 43 |
+
"v_proj",
|
| 44 |
+
"k_proj",
|
| 45 |
+
"in_proj_qkv",
|
| 46 |
+
"gate_proj"
|
| 47 |
+
],
|
| 48 |
+
"target_parameters": null,
|
| 49 |
+
"task_type": "FEATURE_EXTRACTION",
|
| 50 |
+
"trainable_token_indices": null,
|
| 51 |
+
"use_bdlora": null,
|
| 52 |
+
"use_dora": false,
|
| 53 |
+
"use_qalora": false,
|
| 54 |
+
"use_rslora": false,
|
| 55 |
+
"velora_config": null
|
| 56 |
+
}
|
adapter/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6ddaec3fce5f9f5bbd8382b6def9b314f84575deaa5bfcfaf411752df82d1262
|
| 3 |
+
size 21692744
|
build_causal_conv.py
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Build the pinned fast convolution extension in the selected Colab environment."""
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import hashlib
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
import subprocess
|
| 8 |
+
import sys
|
| 9 |
+
import urllib.request
|
| 10 |
+
from pathlib import Path
|
| 11 |
+
|
| 12 |
+
from cuda_toolchain import configure
|
| 13 |
+
|
| 14 |
+
SOURCE_URL = "https://files.pythonhosted.org/packages/f4/d1/eba27735f31bd5527d39a3c7f693e6ded7b844cab275db719a15ad37b6cd/causal_conv1d-1.7.0.tar.gz"
|
| 15 |
+
SOURCE_SHA256 = "3202758494eaa7b597ce1c282dfa188889506bfcb92cad3c407d26736bfcd32b"
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def digest(path):
|
| 19 |
+
with Path(path).open("rb") as stream:
|
| 20 |
+
return hashlib.file_digest(stream, "sha256").hexdigest()
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def main():
|
| 24 |
+
parser = argparse.ArgumentParser()
|
| 25 |
+
parser.add_argument(
|
| 26 |
+
"--output", required=True, help="Build cache outside the public repository"
|
| 27 |
+
)
|
| 28 |
+
parser.add_argument("--install", action="store_true")
|
| 29 |
+
args = parser.parse_args()
|
| 30 |
+
compiler = configure()
|
| 31 |
+
os.environ["PATH"] = (
|
| 32 |
+
str(Path(sys.executable).parent) + os.pathsep + os.environ["PATH"]
|
| 33 |
+
)
|
| 34 |
+
import torch
|
| 35 |
+
|
| 36 |
+
if not torch.cuda.is_available() or torch.__version__ != "2.11.0+cu128":
|
| 37 |
+
raise RuntimeError(
|
| 38 |
+
"Use the recorded Torch CUDA 12.8 environment on the remote GPU"
|
| 39 |
+
)
|
| 40 |
+
output = Path(args.output).resolve()
|
| 41 |
+
output.mkdir(parents=True, exist_ok=True)
|
| 42 |
+
source = output / "causal_conv1d-1.7.0.tar.gz"
|
| 43 |
+
if not source.exists():
|
| 44 |
+
urllib.request.urlretrieve(SOURCE_URL, source)
|
| 45 |
+
if digest(source) != SOURCE_SHA256:
|
| 46 |
+
raise RuntimeError("Convolution source checksum mismatch")
|
| 47 |
+
env = os.environ | {
|
| 48 |
+
"MAX_JOBS": "4",
|
| 49 |
+
"CAUSAL_CONV1D_FORCE_BUILD": "TRUE",
|
| 50 |
+
"TORCH_CUDA_ARCH_LIST": "8.0;8.9",
|
| 51 |
+
}
|
| 52 |
+
subprocess.run(
|
| 53 |
+
[
|
| 54 |
+
sys.executable,
|
| 55 |
+
"-m",
|
| 56 |
+
"pip",
|
| 57 |
+
"wheel",
|
| 58 |
+
"--verbose",
|
| 59 |
+
"--no-build-isolation",
|
| 60 |
+
"--no-deps",
|
| 61 |
+
str(source),
|
| 62 |
+
"--wheel-dir",
|
| 63 |
+
str(output),
|
| 64 |
+
],
|
| 65 |
+
check=True,
|
| 66 |
+
env=env,
|
| 67 |
+
)
|
| 68 |
+
wheels = list(output.glob("causal_conv1d-1.7.0-*.whl"))
|
| 69 |
+
if len(wheels) != 1:
|
| 70 |
+
raise RuntimeError(
|
| 71 |
+
"Expected one wheel; use a clean build directory per Python/CUDA environment"
|
| 72 |
+
)
|
| 73 |
+
if args.install:
|
| 74 |
+
subprocess.run(
|
| 75 |
+
[sys.executable, "-m", "pip", "install", "--no-deps", str(wheels[0])],
|
| 76 |
+
check=True,
|
| 77 |
+
)
|
| 78 |
+
record = {
|
| 79 |
+
"source_url": SOURCE_URL,
|
| 80 |
+
"source_sha256": SOURCE_SHA256,
|
| 81 |
+
"wheel_sha256": digest(wheels[0]),
|
| 82 |
+
"wheel": wheels[0].name,
|
| 83 |
+
"torch": torch.__version__,
|
| 84 |
+
"cuda": torch.version.cuda,
|
| 85 |
+
"python": sys.version.split()[0],
|
| 86 |
+
"installed": args.install,
|
| 87 |
+
"compiler": compiler,
|
| 88 |
+
}
|
| 89 |
+
(output / "build.json").write_text(json.dumps(record, indent=2) + "\n")
|
| 90 |
+
print(json.dumps(record), flush=True)
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
if __name__ == "__main__":
|
| 94 |
+
main()
|
calibration.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"temperature": 3.5697306081553637,
|
| 3 |
+
"status": "fitted on the supplied calibration split only",
|
| 4 |
+
"model_files": {
|
| 5 |
+
"head.safetensors": "dd57fb96318783e558cf29dbfdb9494e6f474d4f41ad4d3a13cae006fcab296c",
|
| 6 |
+
"adapter/adapter_model.safetensors": "6ddaec3fce5f9f5bbd8382b6def9b314f84575deaa5bfcfaf411752df82d1262",
|
| 7 |
+
"model_config.json": "da51f00c1a7a7a4c2cd59940c089a68544a8fb2c64ecea06575273a3171ccce7"
|
| 8 |
+
},
|
| 9 |
+
"backend": "hf-adapter-fp16",
|
| 10 |
+
"data_sha256": "764ee6698c11251ccceaa50c6a625701117d1650f79e773c40167ad3a7f4b638",
|
| 11 |
+
"n": 4894,
|
| 12 |
+
"serving_identity": {
|
| 13 |
+
"version": 1,
|
| 14 |
+
"files": {
|
| 15 |
+
"adapter/adapter_config.json": "9a73a1b1a3d8de88fafcd6b51de34854f950559d725c12498d59d8f3a3946936",
|
| 16 |
+
"adapter/adapter_model.safetensors": "6ddaec3fce5f9f5bbd8382b6def9b314f84575deaa5bfcfaf411752df82d1262",
|
| 17 |
+
"head.safetensors": "dd57fb96318783e558cf29dbfdb9494e6f474d4f41ad4d3a13cae006fcab296c",
|
| 18 |
+
"model_config.json": "da51f00c1a7a7a4c2cd59940c089a68544a8fb2c64ecea06575273a3171ccce7",
|
| 19 |
+
"processor/chat_template.jinja": "273d8e0e683b885071fb17e08d71e5f2a5ddfb5309756181681de4f5a1822d80",
|
| 20 |
+
"processor/processor_config.json": "c10222297bdb55996279fcf25352a0769e7fd2208d114ebeb137b6e141fb3b78",
|
| 21 |
+
"processor/tokenizer.json": "06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523",
|
| 22 |
+
"processor/tokenizer_config.json": "2b99d795f8bbed65c3b297176afff1ff6f6d9ef71bc964c9457c03419c9b857f"
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
}
|
calibration.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Validate calibration against every serving input before constructing a model."""
|
| 2 |
+
|
| 3 |
+
import json
|
| 4 |
+
import math
|
| 5 |
+
import re
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
|
| 8 |
+
from .io import sha256
|
| 9 |
+
|
| 10 |
+
BACKEND = "hf-adapter-fp16"
|
| 11 |
+
UNFITTED = "unfitted for v2"
|
| 12 |
+
FITTED = "fitted on the supplied calibration split only"
|
| 13 |
+
SERVING_FILES = (
|
| 14 |
+
"model_config.json",
|
| 15 |
+
"head.safetensors",
|
| 16 |
+
"adapter/adapter_config.json",
|
| 17 |
+
"adapter/adapter_model.safetensors",
|
| 18 |
+
"processor/tokenizer.json",
|
| 19 |
+
"processor/tokenizer_config.json",
|
| 20 |
+
"processor/processor_config.json",
|
| 21 |
+
"processor/chat_template.jinja",
|
| 22 |
+
)
|
| 23 |
+
LEGACY_FILES = (
|
| 24 |
+
"head.safetensors",
|
| 25 |
+
"adapter/adapter_model.safetensors",
|
| 26 |
+
"model_config.json",
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def positive_temperature(value):
|
| 31 |
+
try:
|
| 32 |
+
valid = type(value) in (int, float) and math.isfinite(value) and value > 0
|
| 33 |
+
except OverflowError:
|
| 34 |
+
valid = False
|
| 35 |
+
if not valid:
|
| 36 |
+
raise ValueError("Calibration temperature must be finite and positive")
|
| 37 |
+
return float(value)
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def model_identity(checkpoint):
|
| 41 |
+
"""Legacy identity retained for compatibility with completed result audits."""
|
| 42 |
+
return {name: sha256(Path(checkpoint) / name) for name in LEGACY_FILES}
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def serving_identity(checkpoint):
|
| 46 |
+
root = Path(checkpoint).resolve()
|
| 47 |
+
files = {}
|
| 48 |
+
for name in SERVING_FILES:
|
| 49 |
+
path = root / name
|
| 50 |
+
if (
|
| 51 |
+
path.is_symlink()
|
| 52 |
+
or not path.resolve().is_relative_to(root)
|
| 53 |
+
or not path.is_file()
|
| 54 |
+
):
|
| 55 |
+
raise ValueError("Missing or unsafe serving file: " + name)
|
| 56 |
+
files[name] = sha256(path)
|
| 57 |
+
return {"version": 1, "files": files}
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def validate_calibration(checkpoint, value, *, backend=BACKEND):
|
| 61 |
+
required = {
|
| 62 |
+
"temperature",
|
| 63 |
+
"status",
|
| 64 |
+
"model_files",
|
| 65 |
+
"backend",
|
| 66 |
+
"data_sha256",
|
| 67 |
+
"n",
|
| 68 |
+
"serving_identity",
|
| 69 |
+
}
|
| 70 |
+
if not isinstance(value, dict) or set(value) != required:
|
| 71 |
+
raise ValueError(
|
| 72 |
+
"Calibration requires versioned serving-file provenance; legacy "
|
| 73 |
+
"metadata must be upgraded using verified evaluation evidence"
|
| 74 |
+
)
|
| 75 |
+
positive_temperature(value["temperature"])
|
| 76 |
+
if backend != BACKEND or value["backend"] != backend:
|
| 77 |
+
raise ValueError("Calibration backend is not qualified")
|
| 78 |
+
if value["status"] != FITTED:
|
| 79 |
+
raise ValueError("Calibration must record a fitted calibration split")
|
| 80 |
+
if type(value["n"]) is not int or value["n"] <= 0:
|
| 81 |
+
raise ValueError("Calibration example count must be a positive integer")
|
| 82 |
+
if not isinstance(value["data_sha256"], str) or not re.fullmatch(
|
| 83 |
+
r"[0-9a-f]{64}", value["data_sha256"]
|
| 84 |
+
):
|
| 85 |
+
raise ValueError("Calibration data identity must be a SHA256 digest")
|
| 86 |
+
binding = value["serving_identity"]
|
| 87 |
+
if (
|
| 88 |
+
not isinstance(binding, dict)
|
| 89 |
+
or set(binding) != {"version", "files"}
|
| 90 |
+
or type(binding["version"]) is not int
|
| 91 |
+
or binding["version"] != 1
|
| 92 |
+
):
|
| 93 |
+
raise ValueError("Unsupported calibration serving identity")
|
| 94 |
+
actual = serving_identity(checkpoint)
|
| 95 |
+
if binding != actual:
|
| 96 |
+
raise ValueError("Calibration was fitted for different serving files")
|
| 97 |
+
if value["model_files"] != {name: actual["files"][name] for name in LEGACY_FILES}:
|
| 98 |
+
raise ValueError("Calibration has a stale legacy model identity")
|
| 99 |
+
return value
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def load_calibration(checkpoint, path, *, backend=BACKEND):
|
| 103 |
+
try:
|
| 104 |
+
value = json.loads(Path(path).read_text())
|
| 105 |
+
except (OSError, ValueError) as error:
|
| 106 |
+
raise ValueError("Cannot read calibration metadata") from error
|
| 107 |
+
return validate_calibration(checkpoint, value, backend=backend)
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
def checkpoint_calibration(checkpoint, config, *, trainable=False):
|
| 111 |
+
"""Training starts unfitted; serving requires either unit T or valid binding."""
|
| 112 |
+
if trainable:
|
| 113 |
+
return 1.0, UNFITTED
|
| 114 |
+
path = Path(checkpoint) / "calibration.json"
|
| 115 |
+
if path.exists():
|
| 116 |
+
value = load_calibration(checkpoint, path)
|
| 117 |
+
return positive_temperature(value["temperature"]), value["status"]
|
| 118 |
+
temperature = positive_temperature(config.get("temperature"))
|
| 119 |
+
status = config.get("calibration_status")
|
| 120 |
+
if (
|
| 121 |
+
temperature != 1.0
|
| 122 |
+
or not isinstance(status, str)
|
| 123 |
+
or not status.startswith("unfitted")
|
| 124 |
+
):
|
| 125 |
+
raise ValueError("Serving calibration is missing its verified binding")
|
| 126 |
+
return 1.0, UNFITTED
|
config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "branchone",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BranchOneModel"
|
| 5 |
+
],
|
| 6 |
+
"branchone_format_version": 1,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_branchone.BranchOneConfig",
|
| 9 |
+
"AutoModel": "modeling_branchone.BranchOneModel"
|
| 10 |
+
}
|
| 11 |
+
}
|
configuration_branchone.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Hugging Face configuration for the calibrated BranchOne inference package."""
|
| 2 |
+
|
| 3 |
+
from transformers import PreTrainedConfig
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class BranchOneConfig(PreTrainedConfig):
|
| 7 |
+
model_type = "branchone"
|
| 8 |
+
|
| 9 |
+
def __init__(self, branchone_format_version=1, **kwargs):
|
| 10 |
+
if type(branchone_format_version) is not int or branchone_format_version != 1:
|
| 11 |
+
raise ValueError("Unsupported BranchOne package format")
|
| 12 |
+
super().__init__(**kwargs)
|
| 13 |
+
self.branchone_format_version = branchone_format_version
|
cuda_toolchain.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Select CUDA 12.8 for extension builds, independently of the runtime driver."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import re
|
| 5 |
+
import subprocess
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
|
| 8 |
+
PACKAGES = [
|
| 9 |
+
"cuda-nvcc-12-8=12.8.93-1",
|
| 10 |
+
"cuda-cudart-dev-12-8=12.8.90-1",
|
| 11 |
+
"cuda-cccl-12-8=12.8.90-1",
|
| 12 |
+
]
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def compiler_version(home):
|
| 16 |
+
compiler = Path(home) / "bin/nvcc"
|
| 17 |
+
if not compiler.is_file():
|
| 18 |
+
return None
|
| 19 |
+
result = subprocess.run(
|
| 20 |
+
[str(compiler), "--version"], capture_output=True, text=True, check=True
|
| 21 |
+
)
|
| 22 |
+
match = re.search(r"release (\d+\.\d+),", result.stdout)
|
| 23 |
+
return match.group(1) if match else None
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def configure(*, install=False):
|
| 27 |
+
candidates = [os.environ.get("CUDA_HOME"), "/usr/local/cuda-12.8"]
|
| 28 |
+
selected = next(
|
| 29 |
+
(Path(p) for p in candidates if p and compiler_version(p) == "12.8"),
|
| 30 |
+
None,
|
| 31 |
+
)
|
| 32 |
+
if selected is None and install:
|
| 33 |
+
if os.geteuid() != 0:
|
| 34 |
+
raise RuntimeError(
|
| 35 |
+
"Install CUDA 12.8 development tools and set CUDA_HOME before setup"
|
| 36 |
+
)
|
| 37 |
+
# Colab provides NVIDIA's signed Ubuntu repository. Install compiler and
|
| 38 |
+
# development headers only; leave the runtime's GPU driver in place.
|
| 39 |
+
subprocess.run(["apt-get", "update", "-qq"], check=True)
|
| 40 |
+
subprocess.run(
|
| 41 |
+
["apt-get", "install", "-y", "--no-install-recommends", *PACKAGES],
|
| 42 |
+
check=True,
|
| 43 |
+
env=os.environ | {"DEBIAN_FRONTEND": "noninteractive"},
|
| 44 |
+
)
|
| 45 |
+
selected = Path("/usr/local/cuda-12.8")
|
| 46 |
+
if selected is None or compiler_version(selected) != "12.8":
|
| 47 |
+
raise RuntimeError(
|
| 48 |
+
"The extension requires a CUDA 12.8 compiler to match Torch cu128; "
|
| 49 |
+
"run setup_colab.py or set CUDA_HOME to a CUDA 12.8 toolkit"
|
| 50 |
+
)
|
| 51 |
+
os.environ["CUDA_HOME"] = str(selected)
|
| 52 |
+
os.environ["PATH"] = str(selected / "bin") + os.pathsep + os.environ["PATH"]
|
| 53 |
+
version = subprocess.check_output(
|
| 54 |
+
[str(selected / "bin/nvcc"), "--version"], text=True
|
| 55 |
+
)
|
| 56 |
+
return {"cuda_home": str(selected), "nvcc": version}
|
head.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Shared candidate scorer; checkpoint parameter names are preserved."""
|
| 2 |
+
|
| 3 |
+
from torch import nn
|
| 4 |
+
|
| 5 |
+
TARGETS = [
|
| 6 |
+
"q_proj",
|
| 7 |
+
"k_proj",
|
| 8 |
+
"v_proj",
|
| 9 |
+
"o_proj",
|
| 10 |
+
"gate_proj",
|
| 11 |
+
"up_proj",
|
| 12 |
+
"down_proj",
|
| 13 |
+
"in_proj_qkv",
|
| 14 |
+
"in_proj_z",
|
| 15 |
+
"in_proj_a",
|
| 16 |
+
"in_proj_b",
|
| 17 |
+
"out_proj",
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class CandidateHead(nn.Module):
|
| 22 |
+
def __init__(self, hidden=1024, width=256, comparison=False):
|
| 23 |
+
super().__init__()
|
| 24 |
+
self.width = width
|
| 25 |
+
self.comparison = comparison
|
| 26 |
+
# Common layers are initialized in the same order for both variants.
|
| 27 |
+
self.norm = nn.LayerNorm(hidden)
|
| 28 |
+
self.project = nn.Linear(hidden, width)
|
| 29 |
+
self.ff_norm = nn.LayerNorm(width)
|
| 30 |
+
self.ff = nn.Sequential(
|
| 31 |
+
nn.Linear(width, width * 2), nn.GELU(), nn.Linear(width * 2, width)
|
| 32 |
+
)
|
| 33 |
+
self.final_norm = nn.LayerNorm(width)
|
| 34 |
+
self.scorer = nn.Linear(width, 1)
|
| 35 |
+
if comparison:
|
| 36 |
+
self.set_norm = nn.LayerNorm(width)
|
| 37 |
+
self.attention = nn.MultiheadAttention(
|
| 38 |
+
width, 4, dropout=0.0, batch_first=True
|
| 39 |
+
)
|
| 40 |
+
# Start as the independent head; learn interactions without perturbing its initial logits.
|
| 41 |
+
nn.init.zeros_(self.attention.out_proj.weight)
|
| 42 |
+
nn.init.zeros_(self.attention.out_proj.bias)
|
| 43 |
+
|
| 44 |
+
def forward(self, h, valid, return_features=False):
|
| 45 |
+
u = self.project(self.norm(h.float()))
|
| 46 |
+
if self.comparison:
|
| 47 |
+
q = self.set_norm(u)
|
| 48 |
+
delta, _ = self.attention(
|
| 49 |
+
q, q, q, key_padding_mask=~valid, need_weights=False
|
| 50 |
+
)
|
| 51 |
+
u = u + delta
|
| 52 |
+
u = u + self.ff(self.ff_norm(u))
|
| 53 |
+
u = self.final_norm(u)
|
| 54 |
+
z = self.scorer(u).squeeze(-1).masked_fill(~valid, -1e9)
|
| 55 |
+
return (z, u) if return_features else z
|
head.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd57fb96318783e558cf29dbfdb9494e6f474d4f41ad4d3a13cae006fcab296c
|
| 3 |
+
size 2115668
|
install.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Create the pinned inference environment and build its CUDA convolution kernel."""
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import os
|
| 5 |
+
import subprocess
|
| 6 |
+
import sys
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
from cuda_toolchain import configure
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def main():
|
| 13 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 14 |
+
parser.add_argument("--venv", default=".venv", help="Destination environment")
|
| 15 |
+
args = parser.parse_args()
|
| 16 |
+
root = Path(__file__).resolve().parent
|
| 17 |
+
venv = Path(args.venv).resolve()
|
| 18 |
+
configure(install=True)
|
| 19 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "uv==0.12.17"], check=True)
|
| 20 |
+
subprocess.run(
|
| 21 |
+
[sys.executable, "-m", "uv", "sync", "--project", str(root), "--locked",
|
| 22 |
+
"--python", "3.13.15"],
|
| 23 |
+
env=os.environ | {"UV_PROJECT_ENVIRONMENT": str(venv)}, check=True,
|
| 24 |
+
)
|
| 25 |
+
subprocess.run(
|
| 26 |
+
[str(venv / "bin/python"), str(root / "build_causal_conv.py"),
|
| 27 |
+
"--output", str(venv / "kernel-build"), "--install"], check=True,
|
| 28 |
+
)
|
| 29 |
+
print("Ready. Run examples with " + str(venv / "bin/python"))
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
if __name__ == "__main__":
|
| 33 |
+
main()
|
io.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""File hashing used by the calibrated inference loader."""
|
| 2 |
+
|
| 3 |
+
import hashlib
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def sha256(path):
|
| 8 |
+
with Path(path).open("rb") as stream:
|
| 9 |
+
return hashlib.file_digest(stream, "sha256").hexdigest()
|
model.py
ADDED
|
@@ -0,0 +1,507 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Native Qwen vision, independent candidate paths, and a shared scalar head.
|
| 2 |
+
|
| 3 |
+
Public base weights remain external inputs. Checkpoints store the adapter,
|
| 4 |
+
head, processor, and immutable backbone revision.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import copy
|
| 8 |
+
import hashlib
|
| 9 |
+
import json
|
| 10 |
+
from collections import OrderedDict
|
| 11 |
+
from pathlib import Path
|
| 12 |
+
|
| 13 |
+
import torch
|
| 14 |
+
from peft import LoraConfig, PeftModel, get_peft_model, get_peft_model_state_dict
|
| 15 |
+
from PIL import Image, ImageOps
|
| 16 |
+
from safetensors.torch import load_file, save_file
|
| 17 |
+
from torch import nn
|
| 18 |
+
from transformers import AutoProcessor, DynamicCache, Qwen3_5Model
|
| 19 |
+
|
| 20 |
+
from .calibration import UNFITTED, checkpoint_calibration
|
| 21 |
+
from .head import TARGETS, CandidateHead
|
| 22 |
+
from .schema import validate
|
| 23 |
+
|
| 24 |
+
MODEL = "Qwen/Qwen3.5-0.8B-Base"
|
| 25 |
+
REVISION = "dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68"
|
| 26 |
+
PROMPT_VERSION = "branchone-multimodal-segments-v2"
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
class BranchOne(nn.Module):
|
| 30 |
+
def __init__(
|
| 31 |
+
self,
|
| 32 |
+
*,
|
| 33 |
+
device="cuda",
|
| 34 |
+
model_id=MODEL,
|
| 35 |
+
revision=REVISION,
|
| 36 |
+
max_length=8192,
|
| 37 |
+
image_tokens=256,
|
| 38 |
+
max_rows=1,
|
| 39 |
+
batch_token_budget=8192,
|
| 40 |
+
adapter_path=None,
|
| 41 |
+
head_path=None,
|
| 42 |
+
trainable=False,
|
| 43 |
+
lora_rank=8,
|
| 44 |
+
processor_path=None,
|
| 45 |
+
hub_options=None,
|
| 46 |
+
):
|
| 47 |
+
super().__init__()
|
| 48 |
+
if not 2 <= max_length <= 32768:
|
| 49 |
+
raise ValueError("Configured context must be between 2 and 32768 tokens")
|
| 50 |
+
self.model_id, self.revision = model_id, revision
|
| 51 |
+
self.max_length, self.image_tokens = max_length, image_tokens
|
| 52 |
+
self.max_rows, self.batch_token_budget = max_rows, batch_token_budget
|
| 53 |
+
self.temperature = 1.0
|
| 54 |
+
self.calibration_status = UNFITTED
|
| 55 |
+
self.cache_validated = False
|
| 56 |
+
self.processor = AutoProcessor.from_pretrained(
|
| 57 |
+
processor_path or model_id, revision=None if processor_path else revision
|
| 58 |
+
)
|
| 59 |
+
self.tokenizer = self.processor.tokenizer
|
| 60 |
+
self.backbone, self.loading_info = Qwen3_5Model.from_pretrained(
|
| 61 |
+
model_id,
|
| 62 |
+
revision=revision,
|
| 63 |
+
dtype=torch.float16,
|
| 64 |
+
attn_implementation="sdpa",
|
| 65 |
+
output_loading_info=True,
|
| 66 |
+
**(hub_options or {}),
|
| 67 |
+
)
|
| 68 |
+
if any(
|
| 69 |
+
self.loading_info.get(k)
|
| 70 |
+
for k in ["missing_keys", "mismatched_keys", "error_msgs"]
|
| 71 |
+
):
|
| 72 |
+
raise RuntimeError(
|
| 73 |
+
f"Incomplete native multimodal weight load: {self.loading_info}"
|
| 74 |
+
)
|
| 75 |
+
self.backbone.requires_grad_(False)
|
| 76 |
+
patch = self.backbone.config.vision_config.patch_size
|
| 77 |
+
merge = self.backbone.config.vision_config.spatial_merge_size
|
| 78 |
+
self.processor.image_processor.size = {
|
| 79 |
+
"shortest_edge": min(64, image_tokens) * (patch * merge) ** 2,
|
| 80 |
+
"longest_edge": image_tokens * (patch * merge) ** 2,
|
| 81 |
+
}
|
| 82 |
+
self.adapter_audit = {"warm_started": bool(adapter_path)}
|
| 83 |
+
if adapter_path:
|
| 84 |
+
self.backbone.language_model = PeftModel.from_pretrained(
|
| 85 |
+
self.backbone.language_model, adapter_path, is_trainable=trainable
|
| 86 |
+
)
|
| 87 |
+
source = load_file(str(Path(adapter_path) / "adapter_model.safetensors"))
|
| 88 |
+
actual = get_peft_model_state_dict(self.backbone.language_model)
|
| 89 |
+
if source.keys() != actual.keys():
|
| 90 |
+
raise RuntimeError("Warm-start adapter tensor names differ")
|
| 91 |
+
error = max(
|
| 92 |
+
float((actual[k].float().cpu() - v.float()).abs().max())
|
| 93 |
+
for k, v in source.items()
|
| 94 |
+
)
|
| 95 |
+
if error != 0:
|
| 96 |
+
raise RuntimeError(f"Warm-start adapter changed: {error}")
|
| 97 |
+
self.adapter_audit.update(tensors=len(source), max_error=error)
|
| 98 |
+
elif lora_rank:
|
| 99 |
+
config = LoraConfig(
|
| 100 |
+
task_type="FEATURE_EXTRACTION",
|
| 101 |
+
r=lora_rank,
|
| 102 |
+
lora_alpha=2 * lora_rank,
|
| 103 |
+
lora_dropout=0.05,
|
| 104 |
+
target_modules=TARGETS,
|
| 105 |
+
)
|
| 106 |
+
self.backbone.language_model = get_peft_model(
|
| 107 |
+
self.backbone.language_model, config
|
| 108 |
+
)
|
| 109 |
+
if not trainable:
|
| 110 |
+
self.backbone.language_model.requires_grad_(False)
|
| 111 |
+
self.lora_rank = lora_rank
|
| 112 |
+
self.head = CandidateHead(hidden=self.backbone.config.text_config.hidden_size)
|
| 113 |
+
if head_path:
|
| 114 |
+
self.head.load_state_dict(load_file(str(head_path)), strict=True)
|
| 115 |
+
self._vision_cache = OrderedDict()
|
| 116 |
+
self._prepared_cache = OrderedDict()
|
| 117 |
+
self.to(device)
|
| 118 |
+
self.train(trainable)
|
| 119 |
+
|
| 120 |
+
@property
|
| 121 |
+
def device(self):
|
| 122 |
+
return next(self.backbone.parameters()).device
|
| 123 |
+
|
| 124 |
+
def train(self, mode=True):
|
| 125 |
+
super().train(mode)
|
| 126 |
+
self.backbone.visual.eval() # frozen vision must stay deterministic
|
| 127 |
+
if mode:
|
| 128 |
+
self.temperature, self.calibration_status = 1.0, UNFITTED
|
| 129 |
+
return self
|
| 130 |
+
|
| 131 |
+
def enable_gradient_checkpointing(self):
|
| 132 |
+
self.backbone.language_model.gradient_checkpointing_enable(
|
| 133 |
+
gradient_checkpointing_kwargs={"use_reentrant": False}
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
@staticmethod
|
| 137 |
+
def _lru_put(cache, key, value, limit=64):
|
| 138 |
+
cache[key] = value
|
| 139 |
+
cache.move_to_end(key)
|
| 140 |
+
while len(cache) > limit:
|
| 141 |
+
cache.popitem(last=False)
|
| 142 |
+
|
| 143 |
+
@staticmethod
|
| 144 |
+
def _image(value):
|
| 145 |
+
if isinstance(value, Image.Image):
|
| 146 |
+
im = ImageOps.exif_transpose(value).convert("RGB")
|
| 147 |
+
elif isinstance(value, (str, Path)):
|
| 148 |
+
if "://" in str(value):
|
| 149 |
+
raise ValueError(
|
| 150 |
+
"Pass a local image path; URL fetching is not supported"
|
| 151 |
+
)
|
| 152 |
+
with Image.open(value) as opened:
|
| 153 |
+
im = ImageOps.exif_transpose(opened).convert("RGB")
|
| 154 |
+
else:
|
| 155 |
+
raise ValueError("image must be a local path or a PIL image")
|
| 156 |
+
content_hash = hashlib.sha256(str(im.size).encode() + im.tobytes()).hexdigest()
|
| 157 |
+
return im, content_hash
|
| 158 |
+
|
| 159 |
+
def prepare(self, request):
|
| 160 |
+
"""Build CPU tensors, enforce expanded token limits, and keep IDs external."""
|
| 161 |
+
validate(request)
|
| 162 |
+
if "images" in request:
|
| 163 |
+
raise ValueError(
|
| 164 |
+
"Use the singular image field; exactly one image is supported"
|
| 165 |
+
)
|
| 166 |
+
image_value = request.get("image")
|
| 167 |
+
image_hash = None
|
| 168 |
+
if image_value is not None:
|
| 169 |
+
im, image_hash = self._image(image_value)
|
| 170 |
+
state = "State:\n" + request["state"] + "\n"
|
| 171 |
+
key = hashlib.sha256(
|
| 172 |
+
json.dumps(
|
| 173 |
+
{
|
| 174 |
+
"state": state,
|
| 175 |
+
"question": request["question"],
|
| 176 |
+
"type": request.get("type", "choice"),
|
| 177 |
+
"image": image_hash,
|
| 178 |
+
"candidates": [c["description"] for c in request["candidates"]],
|
| 179 |
+
"max_length": self.max_length,
|
| 180 |
+
"image_tokens": self.image_tokens,
|
| 181 |
+
},
|
| 182 |
+
sort_keys=True,
|
| 183 |
+
).encode()
|
| 184 |
+
).hexdigest()
|
| 185 |
+
if key in self._prepared_cache:
|
| 186 |
+
self._prepared_cache.move_to_end(key)
|
| 187 |
+
return self._prepared_cache[key]
|
| 188 |
+
|
| 189 |
+
def enc(text):
|
| 190 |
+
return self.tokenizer.encode(text, add_special_tokens=False)
|
| 191 |
+
|
| 192 |
+
pixels = grid = None
|
| 193 |
+
if image_hash:
|
| 194 |
+
text = (
|
| 195 |
+
"State:\n<|vision_start|><|image_pad|><|vision_end|>\n"
|
| 196 |
+
+ request["state"]
|
| 197 |
+
+ "\n"
|
| 198 |
+
)
|
| 199 |
+
processed = self.processor(
|
| 200 |
+
text=text, images=im, add_special_tokens=False, return_tensors="pt"
|
| 201 |
+
)
|
| 202 |
+
state_ids = processed["input_ids"][0].tolist()
|
| 203 |
+
pixels, grid = processed["pixel_values"], processed["image_grid_thw"]
|
| 204 |
+
visual_count = state_ids.count(self.backbone.config.image_token_id)
|
| 205 |
+
if not 0 < visual_count <= self.image_tokens:
|
| 206 |
+
raise ValueError(
|
| 207 |
+
f"Visual token count {visual_count} exceeds budget {self.image_tokens}"
|
| 208 |
+
)
|
| 209 |
+
else:
|
| 210 |
+
state_ids, visual_count = enc(state), 0
|
| 211 |
+
prefix = state_ids + enc(
|
| 212 |
+
"Task: "
|
| 213 |
+
+ request.get("type", "choice")
|
| 214 |
+
+ "\nQuestion:\n"
|
| 215 |
+
+ request["question"]
|
| 216 |
+
+ "\n"
|
| 217 |
+
)
|
| 218 |
+
suffixes = [
|
| 219 |
+
enc("Candidate:\n" + c["description"] + "\nDecision:")
|
| 220 |
+
for c in request["candidates"]
|
| 221 |
+
]
|
| 222 |
+
paths = [prefix + suffix for suffix in suffixes]
|
| 223 |
+
lengths = [len(p) for p in paths]
|
| 224 |
+
if max(lengths) > self.max_length:
|
| 225 |
+
raise ValueError(
|
| 226 |
+
f"Expanded branch has {max(lengths)} tokens; limit {self.max_length}; no truncation"
|
| 227 |
+
)
|
| 228 |
+
result = {
|
| 229 |
+
"paths": paths,
|
| 230 |
+
"prefix": prefix,
|
| 231 |
+
"suffixes": suffixes,
|
| 232 |
+
"pixel_values": pixels,
|
| 233 |
+
"image_grid_thw": grid,
|
| 234 |
+
"image_hash": image_hash,
|
| 235 |
+
"token_counts": lengths,
|
| 236 |
+
"visual_tokens": visual_count,
|
| 237 |
+
"image_size": list(im.size) if image_hash else None,
|
| 238 |
+
}
|
| 239 |
+
self._lru_put(self._prepared_cache, key, result)
|
| 240 |
+
return result
|
| 241 |
+
|
| 242 |
+
@torch.no_grad()
|
| 243 |
+
def visual_features(self, prepared, reuse=True):
|
| 244 |
+
if not prepared["image_hash"]:
|
| 245 |
+
return None
|
| 246 |
+
key = prepared["image_hash"]
|
| 247 |
+
if reuse and key in self._vision_cache:
|
| 248 |
+
self._vision_cache.move_to_end(key)
|
| 249 |
+
return self._vision_cache[key].to(self.device)
|
| 250 |
+
out = self.backbone.get_image_features(
|
| 251 |
+
prepared["pixel_values"].to(self.device),
|
| 252 |
+
prepared["image_grid_thw"].to(self.device),
|
| 253 |
+
return_dict=True,
|
| 254 |
+
)
|
| 255 |
+
features = torch.cat(out.pooler_output, dim=0).detach()
|
| 256 |
+
if reuse:
|
| 257 |
+
self._lru_put(self._vision_cache, key, features.cpu())
|
| 258 |
+
return features
|
| 259 |
+
|
| 260 |
+
def _inputs(self, paths, prepared, features, *, pad_to_bucket=True):
|
| 261 |
+
lengths = torch.tensor([len(p) for p in paths], device=self.device)
|
| 262 |
+
width = int(lengths.max())
|
| 263 |
+
if pad_to_bucket:
|
| 264 |
+
width = ((width + 63) // 64) * 64
|
| 265 |
+
pad_id = self.tokenizer.pad_token_id
|
| 266 |
+
if pad_id is None:
|
| 267 |
+
pad_id = self.tokenizer.eos_token_id
|
| 268 |
+
ids = torch.full(
|
| 269 |
+
(len(paths), width), pad_id, dtype=torch.long, device=self.device
|
| 270 |
+
)
|
| 271 |
+
for i, path in enumerate(paths):
|
| 272 |
+
ids[i, : len(path)] = torch.tensor(path, device=self.device)
|
| 273 |
+
mask = torch.arange(width, device=self.device)[None, :] < lengths[:, None]
|
| 274 |
+
embeds = self.backbone.get_input_embeddings()(ids)
|
| 275 |
+
if features is not None:
|
| 276 |
+
is_image = ids == self.backbone.config.image_token_id
|
| 277 |
+
assert int(is_image.sum()) == len(paths) * features.shape[0]
|
| 278 |
+
embeds = embeds.masked_scatter(
|
| 279 |
+
is_image[..., None], features.repeat(len(paths), 1).to(embeds.dtype)
|
| 280 |
+
)
|
| 281 |
+
grid = prepared["image_grid_thw"].to(self.device).repeat(len(paths), 1)
|
| 282 |
+
positions, _ = self.backbone.get_rope_index(
|
| 283 |
+
ids,
|
| 284 |
+
mm_token_type_ids=is_image.long(),
|
| 285 |
+
image_grid_thw=grid,
|
| 286 |
+
attention_mask=mask.long(),
|
| 287 |
+
)
|
| 288 |
+
else:
|
| 289 |
+
positions = torch.arange(width, device=self.device)[None, :].expand(
|
| 290 |
+
len(paths), -1
|
| 291 |
+
)
|
| 292 |
+
positions = positions.masked_fill(~mask, 0)
|
| 293 |
+
return {
|
| 294 |
+
"inputs_embeds": embeds,
|
| 295 |
+
"attention_mask": mask.long(),
|
| 296 |
+
"position_ids": positions,
|
| 297 |
+
}, lengths
|
| 298 |
+
|
| 299 |
+
def representations(self, request, *, reuse_image=True, max_rows=None):
|
| 300 |
+
prepared = self.prepare(request)
|
| 301 |
+
features = self.visual_features(prepared, reuse=reuse_image)
|
| 302 |
+
paths = prepared["paths"]
|
| 303 |
+
buckets = {}
|
| 304 |
+
for i, p in enumerate(paths):
|
| 305 |
+
buckets.setdefault(((len(p) + 63) // 64) * 64, []).append(i)
|
| 306 |
+
hidden = [None] * len(paths)
|
| 307 |
+
for width, indices in sorted(buckets.items()):
|
| 308 |
+
batch_size = max(
|
| 309 |
+
1, min(max_rows or self.max_rows, self.batch_token_budget // width)
|
| 310 |
+
)
|
| 311 |
+
for start in range(0, len(indices), batch_size):
|
| 312 |
+
group = indices[start : start + batch_size]
|
| 313 |
+
inputs, lengths = self._inputs(
|
| 314 |
+
[paths[i] for i in group], prepared, features
|
| 315 |
+
)
|
| 316 |
+
with torch.autocast(
|
| 317 |
+
"cuda", dtype=torch.float16, enabled=self.device.type == "cuda"
|
| 318 |
+
):
|
| 319 |
+
out = self.backbone.language_model(
|
| 320 |
+
**inputs, use_cache=False
|
| 321 |
+
).last_hidden_state
|
| 322 |
+
leaves = out[
|
| 323 |
+
torch.arange(len(group), device=self.device), lengths - 1
|
| 324 |
+
].float()
|
| 325 |
+
for i, leaf in zip(group, leaves):
|
| 326 |
+
hidden[i] = leaf
|
| 327 |
+
return torch.stack(hidden), prepared
|
| 328 |
+
|
| 329 |
+
def forward(
|
| 330 |
+
self, request, *, return_features=False, reuse_image=True, max_rows=None
|
| 331 |
+
):
|
| 332 |
+
hidden, prepared = self.representations(
|
| 333 |
+
request, reuse_image=reuse_image, max_rows=max_rows
|
| 334 |
+
)
|
| 335 |
+
valid = torch.ones((1, len(hidden)), dtype=torch.bool, device=self.device)
|
| 336 |
+
logits, features = self.head(hidden[None], valid, return_features=True)
|
| 337 |
+
return (logits[0], features[0], prepared) if return_features else logits[0]
|
| 338 |
+
|
| 339 |
+
@torch.inference_mode()
|
| 340 |
+
def native_reference(self, request):
|
| 341 |
+
"""Native full multimodal forward with matching padding for integration checks."""
|
| 342 |
+
prepared = self.prepare(request)
|
| 343 |
+
hidden = []
|
| 344 |
+
for path in prepared["paths"]:
|
| 345 |
+
width = ((len(path) + 63) // 64) * 64
|
| 346 |
+
pad_id = self.tokenizer.pad_token_id
|
| 347 |
+
if pad_id is None:
|
| 348 |
+
pad_id = self.tokenizer.eos_token_id
|
| 349 |
+
ids = torch.tensor(
|
| 350 |
+
[path + [pad_id] * (width - len(path))], device=self.device
|
| 351 |
+
)
|
| 352 |
+
mask = (torch.arange(width, device=self.device)[None] < len(path)).long()
|
| 353 |
+
kwargs = {"input_ids": ids, "attention_mask": mask, "use_cache": False}
|
| 354 |
+
if prepared["image_hash"]:
|
| 355 |
+
kwargs.update(
|
| 356 |
+
pixel_values=prepared["pixel_values"].to(self.device),
|
| 357 |
+
image_grid_thw=prepared["image_grid_thw"].to(self.device),
|
| 358 |
+
mm_token_type_ids=(
|
| 359 |
+
ids == self.backbone.config.image_token_id
|
| 360 |
+
).long(),
|
| 361 |
+
)
|
| 362 |
+
hidden.append(
|
| 363 |
+
self.backbone(**kwargs).last_hidden_state[0, len(path) - 1].float()
|
| 364 |
+
)
|
| 365 |
+
h = torch.stack(hidden)[None]
|
| 366 |
+
return self.head(
|
| 367 |
+
h, torch.ones(h.shape[:2], dtype=torch.bool, device=self.device)
|
| 368 |
+
)[0]
|
| 369 |
+
|
| 370 |
+
@torch.inference_mode()
|
| 371 |
+
def cached_logits(self, request):
|
| 372 |
+
"""Experimental native-cache fork; callers must validate before serving."""
|
| 373 |
+
prepared = self.prepare(request)
|
| 374 |
+
features = self.visual_features(prepared)
|
| 375 |
+
full, _ = self._inputs(
|
| 376 |
+
prepared["paths"], prepared, features, pad_to_bucket=False
|
| 377 |
+
)
|
| 378 |
+
prefix_length = len(prepared["prefix"])
|
| 379 |
+
positions = full["position_ids"]
|
| 380 |
+
prefix_pos = (
|
| 381 |
+
positions[:, :1, :prefix_length]
|
| 382 |
+
if positions.ndim == 3
|
| 383 |
+
else positions[:1, :prefix_length]
|
| 384 |
+
)
|
| 385 |
+
out = self.backbone.language_model(
|
| 386 |
+
inputs_embeds=full["inputs_embeds"][:1, :prefix_length],
|
| 387 |
+
attention_mask=full["attention_mask"][:1, :prefix_length],
|
| 388 |
+
position_ids=prefix_pos,
|
| 389 |
+
past_key_values=DynamicCache(config=self.backbone.config.text_config),
|
| 390 |
+
use_cache=True,
|
| 391 |
+
)
|
| 392 |
+
prefix_cache = out.past_key_values
|
| 393 |
+
hidden = []
|
| 394 |
+
for i, path in enumerate(prepared["paths"]):
|
| 395 |
+
length = len(path)
|
| 396 |
+
pos = (
|
| 397 |
+
positions[:, i : i + 1, prefix_length:length]
|
| 398 |
+
if positions.ndim == 3
|
| 399 |
+
else positions[i : i + 1, prefix_length:length]
|
| 400 |
+
)
|
| 401 |
+
branch = self.backbone.language_model(
|
| 402 |
+
inputs_embeds=full["inputs_embeds"][i : i + 1, prefix_length:length],
|
| 403 |
+
attention_mask=full["attention_mask"][i : i + 1, :length],
|
| 404 |
+
position_ids=pos,
|
| 405 |
+
past_key_values=copy.deepcopy(prefix_cache),
|
| 406 |
+
use_cache=True,
|
| 407 |
+
)
|
| 408 |
+
hidden.append(branch.last_hidden_state[0, -1].float())
|
| 409 |
+
if prefix_cache.get_seq_length() != prefix_length:
|
| 410 |
+
raise RuntimeError("Shared prefix cache was mutated")
|
| 411 |
+
h = torch.stack(hidden)[None]
|
| 412 |
+
return self.head(
|
| 413 |
+
h, torch.ones(h.shape[:2], dtype=torch.bool, device=self.device)
|
| 414 |
+
)[0]
|
| 415 |
+
|
| 416 |
+
@torch.inference_mode()
|
| 417 |
+
def predict(self, request, *, cached=False, threshold=None):
|
| 418 |
+
self.eval()
|
| 419 |
+
if cached and not self.cache_validated:
|
| 420 |
+
raise ValueError(
|
| 421 |
+
"Prefix cache has not passed checkpoint-specific validation"
|
| 422 |
+
)
|
| 423 |
+
logits = self.cached_logits(request) if cached else self(request)
|
| 424 |
+
p = (logits / self.temperature).softmax(-1).cpu()
|
| 425 |
+
ids = [c["id"] for c in request["candidates"]]
|
| 426 |
+
selected = int(p.argmax())
|
| 427 |
+
prepared = self.prepare(request)
|
| 428 |
+
result = {
|
| 429 |
+
"selected_id": ids[selected],
|
| 430 |
+
"candidate_ids": ids,
|
| 431 |
+
"probabilities": p.tolist(),
|
| 432 |
+
"logits": logits.cpu().tolist(),
|
| 433 |
+
"temperature": self.temperature,
|
| 434 |
+
"calibration_status": self.calibration_status,
|
| 435 |
+
"model_version": "branchone-0.3.0-independent",
|
| 436 |
+
"context_limit": self.max_length,
|
| 437 |
+
"branch_token_counts": prepared["token_counts"],
|
| 438 |
+
"visual_tokens": prepared["visual_tokens"],
|
| 439 |
+
"image_size": prepared["image_size"],
|
| 440 |
+
"action": "defer"
|
| 441 |
+
if threshold is None
|
| 442 |
+
else ("accept" if float(p.max()) >= threshold else "defer"),
|
| 443 |
+
"threshold": threshold,
|
| 444 |
+
"deferral_status": "no validated policy"
|
| 445 |
+
if threshold is None
|
| 446 |
+
else "caller-supplied policy",
|
| 447 |
+
}
|
| 448 |
+
if request.get("type") == "boolean":
|
| 449 |
+
result.update(
|
| 450 |
+
p_true=float(p[ids.index("true")]), value=ids[selected] == "true"
|
| 451 |
+
)
|
| 452 |
+
if request.get("type") == "score":
|
| 453 |
+
result["expected_score"] = sum(
|
| 454 |
+
float(x) * c["level"] for x, c in zip(p, request["candidates"])
|
| 455 |
+
)
|
| 456 |
+
return result
|
| 457 |
+
|
| 458 |
+
def save(self, path):
|
| 459 |
+
"""Save trainable weights without carrying calibration to a new payload."""
|
| 460 |
+
path = Path(path)
|
| 461 |
+
path.mkdir(parents=True, exist_ok=True)
|
| 462 |
+
self.backbone.language_model.save_pretrained(path / "adapter")
|
| 463 |
+
save_file(
|
| 464 |
+
{
|
| 465 |
+
k: v.detach().cpu().contiguous()
|
| 466 |
+
for k, v in self.head.state_dict().items()
|
| 467 |
+
},
|
| 468 |
+
str(path / "head.safetensors"),
|
| 469 |
+
)
|
| 470 |
+
self.processor.save_pretrained(path / "processor")
|
| 471 |
+
meta = {
|
| 472 |
+
"model_id": self.model_id,
|
| 473 |
+
"revision": self.revision,
|
| 474 |
+
"max_length": self.max_length,
|
| 475 |
+
"image_tokens": self.image_tokens,
|
| 476 |
+
"max_rows": self.max_rows,
|
| 477 |
+
"batch_token_budget": self.batch_token_budget,
|
| 478 |
+
"lora_rank": self.lora_rank,
|
| 479 |
+
"prompt_version": PROMPT_VERSION,
|
| 480 |
+
"temperature": 1.0,
|
| 481 |
+
"calibration_status": UNFITTED,
|
| 482 |
+
"cache_validated": False,
|
| 483 |
+
}
|
| 484 |
+
(path / "model_config.json").write_text(json.dumps(meta, indent=2))
|
| 485 |
+
(path / "calibration.json").unlink(missing_ok=True)
|
| 486 |
+
|
| 487 |
+
@classmethod
|
| 488 |
+
def load(cls, path, *, device="cuda", trainable=False, hub_options=None):
|
| 489 |
+
path = Path(path)
|
| 490 |
+
meta = json.loads((path / "model_config.json").read_text())
|
| 491 |
+
if meta.pop("prompt_version") != PROMPT_VERSION:
|
| 492 |
+
raise ValueError("Incompatible prompt version")
|
| 493 |
+
temperature, status = checkpoint_calibration(path, meta, trainable=trainable)
|
| 494 |
+
meta.pop("temperature")
|
| 495 |
+
meta.pop("calibration_status")
|
| 496 |
+
meta.pop("cache_validated", None)
|
| 497 |
+
model = cls(
|
| 498 |
+
**meta,
|
| 499 |
+
device=device,
|
| 500 |
+
trainable=trainable,
|
| 501 |
+
adapter_path=path / "adapter",
|
| 502 |
+
head_path=path / "head.safetensors",
|
| 503 |
+
processor_path=path / "processor",
|
| 504 |
+
hub_options=hub_options,
|
| 505 |
+
)
|
| 506 |
+
model.temperature, model.calibration_status = temperature, status
|
| 507 |
+
return model
|
model_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_id": "Qwen/Qwen3.5-0.8B-Base",
|
| 3 |
+
"revision": "dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68",
|
| 4 |
+
"max_length": 8192,
|
| 5 |
+
"image_tokens": 256,
|
| 6 |
+
"max_rows": 1,
|
| 7 |
+
"batch_token_budget": 8192,
|
| 8 |
+
"lora_rank": 8,
|
| 9 |
+
"prompt_version": "branchone-multimodal-segments-v2",
|
| 10 |
+
"temperature": 1.0,
|
| 11 |
+
"calibration_status": "unfitted-after-training",
|
| 12 |
+
"cache_validated": false
|
| 13 |
+
}
|
modeling_branchone.py
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Load the released adapter and decision head through Transformers AutoModel."""
|
| 2 |
+
|
| 3 |
+
import shutil
|
| 4 |
+
import tempfile
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
|
| 7 |
+
import torch
|
| 8 |
+
from huggingface_hub import snapshot_download
|
| 9 |
+
from transformers import PreTrainedModel
|
| 10 |
+
|
| 11 |
+
from .calibration import SERVING_FILES
|
| 12 |
+
from .configuration_branchone import BranchOneConfig
|
| 13 |
+
from .model import BranchOne
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class BranchOneModel(PreTrainedModel):
|
| 17 |
+
config_class = BranchOneConfig
|
| 18 |
+
base_model_prefix = "decision_model"
|
| 19 |
+
main_input_name = "request"
|
| 20 |
+
|
| 21 |
+
def __init__(self, config, decision_model):
|
| 22 |
+
super().__init__(config)
|
| 23 |
+
self.decision_model = decision_model
|
| 24 |
+
# These tensors are already trained. Do not run post_init/initialization.
|
| 25 |
+
self.eval()
|
| 26 |
+
|
| 27 |
+
@classmethod
|
| 28 |
+
def from_pretrained(
|
| 29 |
+
cls,
|
| 30 |
+
pretrained_model_name_or_path,
|
| 31 |
+
*model_args,
|
| 32 |
+
config=None,
|
| 33 |
+
device="cuda",
|
| 34 |
+
revision=None,
|
| 35 |
+
cache_dir=None,
|
| 36 |
+
token=None,
|
| 37 |
+
local_files_only=False,
|
| 38 |
+
force_download=False,
|
| 39 |
+
**kwargs,
|
| 40 |
+
):
|
| 41 |
+
"""Load the fixed FP16 inference backend, without a GitHub dependency.
|
| 42 |
+
|
| 43 |
+
The repository contains an adapter and head. The pinned public Qwen
|
| 44 |
+
backbone downloads separately on first use. Use HF_HUB_OFFLINE=1 after
|
| 45 |
+
caching both repositories when running entirely offline.
|
| 46 |
+
"""
|
| 47 |
+
if model_args:
|
| 48 |
+
raise TypeError("BranchOne takes no positional model arguments")
|
| 49 |
+
for key in ("_from_auto", "_commit_hash", "trust_remote_code"):
|
| 50 |
+
kwargs.pop(key, None)
|
| 51 |
+
if kwargs.pop("adapter_kwargs", None):
|
| 52 |
+
raise ValueError("External adapter overrides are not supported")
|
| 53 |
+
if kwargs.pop("subfolder", ""):
|
| 54 |
+
raise ValueError("Load the root of the BranchOne model repository")
|
| 55 |
+
if kwargs:
|
| 56 |
+
raise TypeError("Unsupported BranchOne loading arguments: " + ", ".join(sorted(kwargs)))
|
| 57 |
+
if torch.device(device).type != "cuda":
|
| 58 |
+
raise ValueError("This release is qualified for CUDA FP16; use device='cuda'")
|
| 59 |
+
if not torch.cuda.is_available():
|
| 60 |
+
raise RuntimeError("A CUDA GPU is required for this release")
|
| 61 |
+
if config is None:
|
| 62 |
+
config = BranchOneConfig.from_pretrained(
|
| 63 |
+
pretrained_model_name_or_path, revision=revision, cache_dir=cache_dir,
|
| 64 |
+
token=token, local_files_only=local_files_only, force_download=force_download,
|
| 65 |
+
)
|
| 66 |
+
files = [*SERVING_FILES, "calibration.json"]
|
| 67 |
+
source = Path(pretrained_model_name_or_path)
|
| 68 |
+
if not source.is_dir():
|
| 69 |
+
# Match the exact commit of the configuration/code resolved by AutoModel.
|
| 70 |
+
source = Path(snapshot_download(
|
| 71 |
+
repo_id=str(pretrained_model_name_or_path),
|
| 72 |
+
revision=getattr(config, "_commit_hash", None) or revision,
|
| 73 |
+
cache_dir=cache_dir, token=token, local_files_only=local_files_only,
|
| 74 |
+
force_download=force_download, allow_patterns=files,
|
| 75 |
+
))
|
| 76 |
+
# HF caches may use links to a blob store. Materialize only the allowlisted
|
| 77 |
+
# files, then let the existing calibration guard check every file's bytes.
|
| 78 |
+
with tempfile.TemporaryDirectory(prefix="branchone-inference-") as directory:
|
| 79 |
+
checkpoint = Path(directory)
|
| 80 |
+
for name in files:
|
| 81 |
+
destination = checkpoint / name
|
| 82 |
+
destination.parent.mkdir(parents=True, exist_ok=True)
|
| 83 |
+
shutil.copyfile(source / name, destination)
|
| 84 |
+
decision_model = BranchOne.load(
|
| 85 |
+
checkpoint, device=device, trainable=False,
|
| 86 |
+
hub_options={"cache_dir": cache_dir, "token": token,
|
| 87 |
+
"local_files_only": local_files_only,
|
| 88 |
+
"force_download": force_download},
|
| 89 |
+
)
|
| 90 |
+
return cls(config, decision_model)
|
| 91 |
+
|
| 92 |
+
@torch.inference_mode()
|
| 93 |
+
def forward(self, request):
|
| 94 |
+
"""Return one unscaled logit per supplied candidate."""
|
| 95 |
+
return self.decision_model(request)
|
| 96 |
+
|
| 97 |
+
def predict(self, request, *, threshold=None):
|
| 98 |
+
"""Return aligned candidate probabilities, selected ID, and policy metadata."""
|
| 99 |
+
return self.decision_model.predict(request, threshold=threshold)
|
| 100 |
+
|
| 101 |
+
def save_pretrained(self, *args, **kwargs):
|
| 102 |
+
raise NotImplementedError(
|
| 103 |
+
"This is an inference package. Preserve the downloaded repository files "
|
| 104 |
+
"to keep the adapter, processor, and calibration binding together."
|
| 105 |
+
)
|
processor/chat_template.jinja
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 46 |
+
{{- '<|im_start|>system\n' }}
|
| 47 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 48 |
+
{%- for tool in tools %}
|
| 49 |
+
{{- "\n" }}
|
| 50 |
+
{{- tool | tojson }}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{{- "\n</tools>" }}
|
| 53 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 54 |
+
{%- if messages[0].role == 'system' %}
|
| 55 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 56 |
+
{%- if content %}
|
| 57 |
+
{{- '\n\n' + content }}
|
| 58 |
+
{%- endif %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<|im_end|>\n' }}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{%- if messages[0].role == 'system' %}
|
| 63 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 64 |
+
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 68 |
+
{%- for message in messages[::-1] %}
|
| 69 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 70 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 71 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 72 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 73 |
+
{%- set ns.multi_step_tool = false %}
|
| 74 |
+
{%- set ns.last_query_index = index %}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- endif %}
|
| 77 |
+
{%- endfor %}
|
| 78 |
+
{%- if ns.multi_step_tool %}
|
| 79 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 80 |
+
{%- endif %}
|
| 81 |
+
{%- for message in messages %}
|
| 82 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 83 |
+
{%- if message.role == "system" %}
|
| 84 |
+
{%- if not loop.first %}
|
| 85 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- elif message.role == "user" %}
|
| 88 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 89 |
+
{%- elif message.role == "assistant" %}
|
| 90 |
+
{%- set reasoning_content = '' %}
|
| 91 |
+
{%- if message.reasoning_content is string %}
|
| 92 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 93 |
+
{%- else %}
|
| 94 |
+
{%- if '</think>' in content %}
|
| 95 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 96 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endif %}
|
| 99 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 100 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 101 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 102 |
+
{%- else %}
|
| 103 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 104 |
+
{%- endif %}
|
| 105 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 106 |
+
{%- for tool_call in message.tool_calls %}
|
| 107 |
+
{%- if tool_call.function is defined %}
|
| 108 |
+
{%- set tool_call = tool_call.function %}
|
| 109 |
+
{%- endif %}
|
| 110 |
+
{%- if loop.first %}
|
| 111 |
+
{%- if content|trim %}
|
| 112 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 113 |
+
{%- else %}
|
| 114 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 115 |
+
{%- endif %}
|
| 116 |
+
{%- else %}
|
| 117 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 118 |
+
{%- endif %}
|
| 119 |
+
{%- if tool_call.arguments is defined %}
|
| 120 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 121 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 122 |
+
{%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
|
| 123 |
+
{{- args_value }}
|
| 124 |
+
{{- '\n</parameter>\n' }}
|
| 125 |
+
{%- endfor %}
|
| 126 |
+
{%- endif %}
|
| 127 |
+
{{- '</function>\n</tool_call>' }}
|
| 128 |
+
{%- endfor %}
|
| 129 |
+
{%- endif %}
|
| 130 |
+
{{- '<|im_end|>\n' }}
|
| 131 |
+
{%- elif message.role == "tool" %}
|
| 132 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 133 |
+
{{- '<|im_start|>user' }}
|
| 134 |
+
{%- endif %}
|
| 135 |
+
{{- '\n<tool_response>\n' }}
|
| 136 |
+
{{- content }}
|
| 137 |
+
{{- '\n</tool_response>' }}
|
| 138 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 139 |
+
{{- '<|im_end|>\n' }}
|
| 140 |
+
{%- elif loop.last %}
|
| 141 |
+
{{- '<|im_end|>\n' }}
|
| 142 |
+
{%- endif %}
|
| 143 |
+
{%- else %}
|
| 144 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{%- endfor %}
|
| 147 |
+
{%- if add_generation_prompt %}
|
| 148 |
+
{{- '<|im_start|>assistant\n' }}
|
| 149 |
+
{%- if enable_thinking is defined and enable_thinking is true %}
|
| 150 |
+
{{- '<think>\n' }}
|
| 151 |
+
{%- else %}
|
| 152 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 153 |
+
{%- endif %}
|
| 154 |
+
{%- endif %}
|
processor/processor_config.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"do_convert_rgb": true,
|
| 4 |
+
"do_normalize": true,
|
| 5 |
+
"do_rescale": true,
|
| 6 |
+
"do_resize": true,
|
| 7 |
+
"image_mean": [
|
| 8 |
+
0.5,
|
| 9 |
+
0.5,
|
| 10 |
+
0.5
|
| 11 |
+
],
|
| 12 |
+
"image_processor_type": "Qwen2VLImageProcessor",
|
| 13 |
+
"image_std": [
|
| 14 |
+
0.5,
|
| 15 |
+
0.5,
|
| 16 |
+
0.5
|
| 17 |
+
],
|
| 18 |
+
"merge_size": 2,
|
| 19 |
+
"patch_size": 16,
|
| 20 |
+
"resample": 3,
|
| 21 |
+
"rescale_factor": 0.00392156862745098,
|
| 22 |
+
"size": {
|
| 23 |
+
"longest_edge": 262144,
|
| 24 |
+
"shortest_edge": 65536
|
| 25 |
+
},
|
| 26 |
+
"temporal_patch_size": 2
|
| 27 |
+
},
|
| 28 |
+
"processor_class": "Qwen3VLProcessor",
|
| 29 |
+
"video_processor": {
|
| 30 |
+
"do_convert_rgb": true,
|
| 31 |
+
"do_normalize": true,
|
| 32 |
+
"do_rescale": true,
|
| 33 |
+
"do_resize": true,
|
| 34 |
+
"do_sample_frames": true,
|
| 35 |
+
"fps": 2,
|
| 36 |
+
"image_mean": [
|
| 37 |
+
0.5,
|
| 38 |
+
0.5,
|
| 39 |
+
0.5
|
| 40 |
+
],
|
| 41 |
+
"image_std": [
|
| 42 |
+
0.5,
|
| 43 |
+
0.5,
|
| 44 |
+
0.5
|
| 45 |
+
],
|
| 46 |
+
"max_frames": 768,
|
| 47 |
+
"max_video_tokens": 768,
|
| 48 |
+
"merge_size": 2,
|
| 49 |
+
"min_frames": 4,
|
| 50 |
+
"patch_size": 16,
|
| 51 |
+
"resample": 3,
|
| 52 |
+
"rescale_factor": 0.00392156862745098,
|
| 53 |
+
"return_metadata": false,
|
| 54 |
+
"size": {
|
| 55 |
+
"longest_edge": 234881024,
|
| 56 |
+
"shortest_edge": 4096
|
| 57 |
+
},
|
| 58 |
+
"temporal_patch_size": 2,
|
| 59 |
+
"video_processor_type": "Qwen3VLVideoProcessor"
|
| 60 |
+
}
|
| 61 |
+
}
|
processor/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523
|
| 3 |
+
size 19989325
|
processor/tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"audio_bos_token": "<|audio_start|>",
|
| 4 |
+
"audio_eos_token": "<|audio_end|>",
|
| 5 |
+
"audio_token": "<|audio_pad|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"bos_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"eos_token": "<|endoftext|>",
|
| 10 |
+
"errors": "replace",
|
| 11 |
+
"image_token": "<|image_pad|>",
|
| 12 |
+
"is_local": true,
|
| 13 |
+
"local_files_only": false,
|
| 14 |
+
"model_max_length": 262144,
|
| 15 |
+
"model_specific_special_tokens": {
|
| 16 |
+
"audio_bos_token": "<|audio_start|>",
|
| 17 |
+
"audio_eos_token": "<|audio_end|>",
|
| 18 |
+
"audio_token": "<|audio_pad|>",
|
| 19 |
+
"image_token": "<|image_pad|>",
|
| 20 |
+
"video_token": "<|video_pad|>",
|
| 21 |
+
"vision_bos_token": "<|vision_start|>",
|
| 22 |
+
"vision_eos_token": "<|vision_end|>"
|
| 23 |
+
},
|
| 24 |
+
"pad_token": "<|endoftext|>",
|
| 25 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
+
"processor_class": "Qwen3VLProcessor",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
+
"unk_token": null,
|
| 30 |
+
"video_token": "<|video_pad|>",
|
| 31 |
+
"vision_bos_token": "<|vision_start|>",
|
| 32 |
+
"vision_eos_token": "<|vision_end|>"
|
| 33 |
+
}
|
pyproject.toml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "branchone-inference-environment"
|
| 3 |
+
version = "1.0.0"
|
| 4 |
+
description = "Pinned CUDA inference dependencies for BranchOne"
|
| 5 |
+
requires-python = ">=3.13,<3.14"
|
| 6 |
+
dependencies = [
|
| 7 |
+
"torch==2.11.0+cu128",
|
| 8 |
+
"torchvision==0.26.0+cu128",
|
| 9 |
+
"transformers==5.17.0",
|
| 10 |
+
"peft==0.21.0",
|
| 11 |
+
"accelerate==1.14.0",
|
| 12 |
+
"flash-linear-attention==0.5.2",
|
| 13 |
+
"fla-core==0.5.2",
|
| 14 |
+
"safetensors==0.8.0",
|
| 15 |
+
"numpy==2.5.3",
|
| 16 |
+
"Pillow==12.1.1",
|
| 17 |
+
"huggingface-hub==1.33.0",
|
| 18 |
+
"ninja",
|
| 19 |
+
"packaging",
|
| 20 |
+
"wheel",
|
| 21 |
+
"setuptools",
|
| 22 |
+
"pip",
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
+
[tool.uv]
|
| 26 |
+
package = false
|
| 27 |
+
environments = ["sys_platform == 'linux' and platform_machine == 'x86_64'"]
|
| 28 |
+
|
| 29 |
+
[[tool.uv.index]]
|
| 30 |
+
name = "pytorch-cu128"
|
| 31 |
+
url = "https://download.pytorch.org/whl/cu128"
|
| 32 |
+
explicit = true
|
| 33 |
+
|
| 34 |
+
[tool.uv.sources]
|
| 35 |
+
torch = { index = "pytorch-cu128" }
|
| 36 |
+
torchvision = { index = "pytorch-cu128" }
|
schema.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Typed runtime schemas; candidate IDs never enter the encoder."""
|
| 2 |
+
|
| 3 |
+
import math
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def validate(row, max_candidates=150):
|
| 7 |
+
for name in ["state", "question"]:
|
| 8 |
+
if not isinstance(row.get(name), str) or (
|
| 9 |
+
name == "question" and not row[name].strip()
|
| 10 |
+
):
|
| 11 |
+
raise ValueError(
|
| 12 |
+
f"{name} must be a string"
|
| 13 |
+
+ ("" if name == "state" else " with content")
|
| 14 |
+
)
|
| 15 |
+
typ = row.get("type", "choice")
|
| 16 |
+
if typ not in ["choice", "boolean", "score"]:
|
| 17 |
+
raise ValueError("Unknown decision type")
|
| 18 |
+
cs = row.get("candidates")
|
| 19 |
+
if not isinstance(cs, list) or not 2 <= len(cs) <= max_candidates:
|
| 20 |
+
raise ValueError(f"Expected 2..{max_candidates} candidates")
|
| 21 |
+
ids = []
|
| 22 |
+
for c in cs:
|
| 23 |
+
if not isinstance(c, dict):
|
| 24 |
+
raise ValueError("Candidate must be an object")
|
| 25 |
+
if not isinstance(c.get("id"), str) or not c["id"].strip():
|
| 26 |
+
raise ValueError("Candidate IDs must be nonempty strings")
|
| 27 |
+
if not isinstance(c.get("description"), str) or not c["description"].strip():
|
| 28 |
+
raise ValueError("Candidate descriptions must be nonempty strings")
|
| 29 |
+
ids.append(c["id"])
|
| 30 |
+
if len(set(ids)) != len(ids):
|
| 31 |
+
raise ValueError("Candidate IDs must be unique")
|
| 32 |
+
if typ == "boolean" and set(ids) != {"false", "true"}:
|
| 33 |
+
raise ValueError("Boolean candidates must use false and true IDs")
|
| 34 |
+
if typ == "score":
|
| 35 |
+
levels = [c.get("level") for c in cs]
|
| 36 |
+
if any(
|
| 37 |
+
isinstance(v, bool)
|
| 38 |
+
or not isinstance(v, (int, float))
|
| 39 |
+
or not math.isfinite(v)
|
| 40 |
+
for v in levels
|
| 41 |
+
):
|
| 42 |
+
raise ValueError("Score candidates need finite numeric levels")
|
| 43 |
+
if any(a >= b for a, b in zip(levels, levels[1:])):
|
| 44 |
+
raise ValueError("Score levels must be strictly increasing")
|
| 45 |
+
return row
|
uv.lock
ADDED
|
@@ -0,0 +1,788 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version = 1
|
| 2 |
+
revision = 3
|
| 3 |
+
requires-python = "==3.13.*"
|
| 4 |
+
resolution-markers = [
|
| 5 |
+
"platform_machine == 'x86_64' and sys_platform == 'linux'",
|
| 6 |
+
]
|
| 7 |
+
supported-markers = [
|
| 8 |
+
"platform_machine == 'x86_64' and sys_platform == 'linux'",
|
| 9 |
+
]
|
| 10 |
+
|
| 11 |
+
[[package]]
|
| 12 |
+
name = "accelerate"
|
| 13 |
+
version = "1.14.0"
|
| 14 |
+
source = { registry = "https://pypi.org/simple" }
|
| 15 |
+
dependencies = [
|
| 16 |
+
{ name = "huggingface-hub" },
|
| 17 |
+
{ name = "numpy" },
|
| 18 |
+
{ name = "packaging" },
|
| 19 |
+
{ name = "psutil" },
|
| 20 |
+
{ name = "pyyaml" },
|
| 21 |
+
{ name = "safetensors" },
|
| 22 |
+
{ name = "torch" },
|
| 23 |
+
]
|
| 24 |
+
sdist = { url = "https://files.pythonhosted.org/packages/8d/75/94cd5d389649578aca399e5aa822637eec18319a1dadc400ffe2f9a7493f/accelerate-1.14.0.tar.gz", hash = "sha256:41b9c4377a54e0b460a959b0defa1b736e4ca0a2373252d9a539964c2afe3c8d", size = 412167, upload-time = "2026-06-11T13:45:52.326Z" }
|
| 25 |
+
wheels = [
|
| 26 |
+
{ url = "https://files.pythonhosted.org/packages/a8/db/253133d7e7cb40d3af384bb2f5c0b4a2b7fdcffbc95c688cc67a20a3c103/accelerate-1.14.0-py3-none-any.whl", hash = "sha256:e94390c2863b873be18f623f9df48a0d8fe5eff13ea7f1a00092b0a7904888c6", size = 389246, upload-time = "2026-06-11T13:45:50.477Z" },
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
[[package]]
|
| 30 |
+
name = "annotated-doc"
|
| 31 |
+
version = "0.0.5"
|
| 32 |
+
source = { registry = "https://pypi.org/simple" }
|
| 33 |
+
sdist = { url = "https://files.pythonhosted.org/packages/5a/8e/38aa427ed5402449e226975b649c5dc73ccadfefeb95e6aecb8f8ea4b6b6/annotated_doc-0.0.5.tar.gz", hash = "sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb", size = 10758, upload-time = "2026-07-28T13:50:58.129Z" }
|
| 34 |
+
wheels = [
|
| 35 |
+
{ url = "https://files.pythonhosted.org/packages/3e/30/e900b21425a860e195f32e37657aa1f7c7f2b1bfb26f03ca209b90933c06/annotated_doc-0.0.5-py3-none-any.whl", hash = "sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101", size = 5302, upload-time = "2026-07-28T13:50:57.239Z" },
|
| 36 |
+
]
|
| 37 |
+
|
| 38 |
+
[[package]]
|
| 39 |
+
name = "anyio"
|
| 40 |
+
version = "4.15.1"
|
| 41 |
+
source = { registry = "https://pypi.org/simple" }
|
| 42 |
+
dependencies = [
|
| 43 |
+
{ name = "idna" },
|
| 44 |
+
{ name = "typing-extensions" },
|
| 45 |
+
]
|
| 46 |
+
sdist = { url = "https://files.pythonhosted.org/packages/a9/d2/f4d173e22df740bc37b1db102b386ba719b66e95b0f0d751f556b387e6d2/anyio-4.15.1.tar.gz", hash = "sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94", size = 276966, upload-time = "2026-09-05T10:42:39.44Z" }
|
| 47 |
+
wheels = [
|
| 48 |
+
{ url = "https://files.pythonhosted.org/packages/12/b8/4bd346e22b28902df4d651910f5242c28d84e4a5c2435ca5c3f797ed7e2e/anyio-4.15.1-py3-none-any.whl", hash = "sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101", size = 132079, upload-time = "2026-09-05T10:42:37.923Z" },
|
| 49 |
+
]
|
| 50 |
+
|
| 51 |
+
[[package]]
|
| 52 |
+
name = "branchone-inference-environment"
|
| 53 |
+
version = "1.0.0"
|
| 54 |
+
source = { virtual = "." }
|
| 55 |
+
dependencies = [
|
| 56 |
+
{ name = "accelerate" },
|
| 57 |
+
{ name = "fla-core" },
|
| 58 |
+
{ name = "flash-linear-attention" },
|
| 59 |
+
{ name = "huggingface-hub" },
|
| 60 |
+
{ name = "ninja" },
|
| 61 |
+
{ name = "numpy" },
|
| 62 |
+
{ name = "packaging" },
|
| 63 |
+
{ name = "peft" },
|
| 64 |
+
{ name = "pillow" },
|
| 65 |
+
{ name = "pip" },
|
| 66 |
+
{ name = "safetensors" },
|
| 67 |
+
{ name = "setuptools" },
|
| 68 |
+
{ name = "torch" },
|
| 69 |
+
{ name = "torchvision" },
|
| 70 |
+
{ name = "transformers" },
|
| 71 |
+
{ name = "wheel" },
|
| 72 |
+
]
|
| 73 |
+
|
| 74 |
+
[package.metadata]
|
| 75 |
+
requires-dist = [
|
| 76 |
+
{ name = "accelerate", specifier = "==1.14.0" },
|
| 77 |
+
{ name = "fla-core", specifier = "==0.5.2" },
|
| 78 |
+
{ name = "flash-linear-attention", specifier = "==0.5.2" },
|
| 79 |
+
{ name = "huggingface-hub", specifier = "==1.33.0" },
|
| 80 |
+
{ name = "ninja" },
|
| 81 |
+
{ name = "numpy", specifier = "==2.5.3" },
|
| 82 |
+
{ name = "packaging" },
|
| 83 |
+
{ name = "peft", specifier = "==0.21.0" },
|
| 84 |
+
{ name = "pillow", specifier = "==12.1.1" },
|
| 85 |
+
{ name = "pip" },
|
| 86 |
+
{ name = "safetensors", specifier = "==0.8.0" },
|
| 87 |
+
{ name = "setuptools" },
|
| 88 |
+
{ name = "torch", specifier = "==2.11.0+cu128", index = "https://download.pytorch.org/whl/cu128" },
|
| 89 |
+
{ name = "torchvision", specifier = "==0.26.0+cu128", index = "https://download.pytorch.org/whl/cu128" },
|
| 90 |
+
{ name = "transformers", specifier = "==5.17.0" },
|
| 91 |
+
{ name = "wheel" },
|
| 92 |
+
]
|
| 93 |
+
|
| 94 |
+
[[package]]
|
| 95 |
+
name = "certifi"
|
| 96 |
+
version = "2026.7.22"
|
| 97 |
+
source = { registry = "https://pypi.org/simple" }
|
| 98 |
+
sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" }
|
| 99 |
+
wheels = [
|
| 100 |
+
{ url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" },
|
| 101 |
+
]
|
| 102 |
+
|
| 103 |
+
[[package]]
|
| 104 |
+
name = "click"
|
| 105 |
+
version = "8.5.0"
|
| 106 |
+
source = { registry = "https://pypi.org/simple" }
|
| 107 |
+
sdist = { url = "https://files.pythonhosted.org/packages/c7/0e/7fa0ef50764b67090eca4114772a2abf8b6148198475e54c660b97caeee6/click-8.5.0.tar.gz", hash = "sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34", size = 382235, upload-time = "2026-08-26T13:33:14.56Z" }
|
| 108 |
+
wheels = [
|
| 109 |
+
{ url = "https://files.pythonhosted.org/packages/58/50/6c0d534c5f134586a8e1ba4e330569e32f057e33372ae556463212fb4cd3/click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360", size = 125251, upload-time = "2026-08-26T13:33:12.928Z" },
|
| 110 |
+
]
|
| 111 |
+
|
| 112 |
+
[[package]]
|
| 113 |
+
name = "cuda-bindings"
|
| 114 |
+
version = "12.9.9"
|
| 115 |
+
source = { registry = "https://pypi.org/simple" }
|
| 116 |
+
dependencies = [
|
| 117 |
+
{ name = "cuda-pathfinder" },
|
| 118 |
+
]
|
| 119 |
+
wheels = [
|
| 120 |
+
{ url = "https://files.pythonhosted.org/packages/ef/c8/0d7703abc9df0871965f9b6eafd881a261f156a168beca9050052ca3e4ab/cuda_bindings-12.9.9-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d399447bf5d929d6f59ec4e2c7b26d11ef21e8be5e88995e41c705db1a7c1363", size = 7398149, upload-time = "2026-09-23T03:20:55.718Z" },
|
| 121 |
+
]
|
| 122 |
+
|
| 123 |
+
[[package]]
|
| 124 |
+
name = "cuda-pathfinder"
|
| 125 |
+
version = "1.8.3"
|
| 126 |
+
source = { registry = "https://pypi.org/simple" }
|
| 127 |
+
wheels = [
|
| 128 |
+
{ url = "https://files.pythonhosted.org/packages/b9/fb/f8e1890428f9f590b4beebd63b068aac1ce32a3331510c847b9f9a78f261/cuda_pathfinder-1.8.3-py3-none-any.whl", hash = "sha256:e29e59829c297a7a5233bd9cc71094fc5bddbd076951482670178f9eade39b1f", size = 62561, upload-time = "2026-10-02T03:20:23.712Z" },
|
| 129 |
+
]
|
| 130 |
+
|
| 131 |
+
[[package]]
|
| 132 |
+
name = "cuda-toolkit"
|
| 133 |
+
version = "12.8.1"
|
| 134 |
+
source = { registry = "https://pypi.org/simple" }
|
| 135 |
+
wheels = [
|
| 136 |
+
{ url = "https://files.pythonhosted.org/packages/d4/c8/7dce3a0b15b42a3b58e7d96eb22a687d3bf2c44e01d149a6874629cd9938/cuda_toolkit-12.8.1-py2.py3-none-any.whl", hash = "sha256:adc7906af4ecbf9a352f9dca5734eceb21daec281ccfcf5675e1d2f724fc2cba", size = 2283, upload-time = "2025-08-13T02:03:07.842Z" },
|
| 137 |
+
]
|
| 138 |
+
|
| 139 |
+
[package.optional-dependencies]
|
| 140 |
+
cublas = [
|
| 141 |
+
{ name = "nvidia-cublas-cu12" },
|
| 142 |
+
]
|
| 143 |
+
cudart = [
|
| 144 |
+
{ name = "nvidia-cuda-runtime-cu12" },
|
| 145 |
+
]
|
| 146 |
+
cufft = [
|
| 147 |
+
{ name = "nvidia-cufft-cu12" },
|
| 148 |
+
]
|
| 149 |
+
cufile = [
|
| 150 |
+
{ name = "nvidia-cufile-cu12" },
|
| 151 |
+
]
|
| 152 |
+
cupti = [
|
| 153 |
+
{ name = "nvidia-cuda-cupti-cu12" },
|
| 154 |
+
]
|
| 155 |
+
curand = [
|
| 156 |
+
{ name = "nvidia-curand-cu12" },
|
| 157 |
+
]
|
| 158 |
+
cusolver = [
|
| 159 |
+
{ name = "nvidia-cusolver-cu12" },
|
| 160 |
+
]
|
| 161 |
+
cusparse = [
|
| 162 |
+
{ name = "nvidia-cusparse-cu12" },
|
| 163 |
+
]
|
| 164 |
+
nvjitlink = [
|
| 165 |
+
{ name = "nvidia-nvjitlink-cu12" },
|
| 166 |
+
]
|
| 167 |
+
nvrtc = [
|
| 168 |
+
{ name = "nvidia-cuda-nvrtc-cu12" },
|
| 169 |
+
]
|
| 170 |
+
nvtx = [
|
| 171 |
+
{ name = "nvidia-nvtx-cu12" },
|
| 172 |
+
]
|
| 173 |
+
|
| 174 |
+
[[package]]
|
| 175 |
+
name = "einops"
|
| 176 |
+
version = "0.8.2"
|
| 177 |
+
source = { registry = "https://pypi.org/simple" }
|
| 178 |
+
sdist = { url = "https://files.pythonhosted.org/packages/2c/77/850bef8d72ffb9219f0b1aac23fbc1bf7d038ee6ea666f331fa273031aa2/einops-0.8.2.tar.gz", hash = "sha256:609da665570e5e265e27283aab09e7f279ade90c4f01bcfca111f3d3e13f2827", size = 56261, upload-time = "2026-01-26T04:13:17.638Z" }
|
| 179 |
+
wheels = [
|
| 180 |
+
{ url = "https://files.pythonhosted.org/packages/2a/09/f8d8f8f31e4483c10a906437b4ce31bdf3d6d417b73fe33f1a8b59e34228/einops-0.8.2-py3-none-any.whl", hash = "sha256:54058201ac7087911181bfec4af6091bb59380360f069276601256a76af08193", size = 65638, upload-time = "2026-01-26T04:13:18.546Z" },
|
| 181 |
+
]
|
| 182 |
+
|
| 183 |
+
[[package]]
|
| 184 |
+
name = "filelock"
|
| 185 |
+
version = "4.0.12"
|
| 186 |
+
source = { registry = "https://pypi.org/simple" }
|
| 187 |
+
sdist = { url = "https://files.pythonhosted.org/packages/53/e4/34efcb869715cf299e47d1ac7b2624d2bcb6f2d3dffc2f0abe8417f65ab2/filelock-4.0.12.tar.gz", hash = "sha256:cf42711a7ac791818b299fab0332a088c65aeeefa36290de98db92c434303b0c", size = 253880, upload-time = "2026-10-05T13:17:43.677Z" }
|
| 188 |
+
wheels = [
|
| 189 |
+
{ url = "https://files.pythonhosted.org/packages/da/a1/b047e1c486a2c66283633b7dbb73872ca16ca1ce6a426f70d4d037fc8e1c/filelock-4.0.12-py3-none-any.whl", hash = "sha256:5f17ee83ecee8a6f3e389c75822fb70a1c2f0506b99438a6dffa1d56793588c8", size = 111732, upload-time = "2026-10-05T13:17:42.361Z" },
|
| 190 |
+
]
|
| 191 |
+
|
| 192 |
+
[[package]]
|
| 193 |
+
name = "fla-core"
|
| 194 |
+
version = "0.5.2"
|
| 195 |
+
source = { registry = "https://pypi.org/simple" }
|
| 196 |
+
dependencies = [
|
| 197 |
+
{ name = "einops" },
|
| 198 |
+
]
|
| 199 |
+
sdist = { url = "https://files.pythonhosted.org/packages/94/85/20bdc0fbbbaeec27b5b198e0dbbbc51161a267066a4aebd9e4b413637c6c/fla_core-0.5.2.tar.gz", hash = "sha256:9360fc412f784c1c8f05c320ec2902d5d968764178c9b8a92efc919e17a39680", size = 587835, upload-time = "2026-07-27T18:26:19.424Z" }
|
| 200 |
+
wheels = [
|
| 201 |
+
{ url = "https://files.pythonhosted.org/packages/2d/ed/dfe19c4da779957eb6a42a26812f9b4e2280bf757a17a71933ff59ffcb98/fla_core-0.5.2-py3-none-any.whl", hash = "sha256:5e830c85bad3d0d34677f98ac7074d08687a3756f0f0499d95ceb96eb6920761", size = 819225, upload-time = "2026-07-27T18:26:16.147Z" },
|
| 202 |
+
]
|
| 203 |
+
|
| 204 |
+
[[package]]
|
| 205 |
+
name = "flash-linear-attention"
|
| 206 |
+
version = "0.5.2"
|
| 207 |
+
source = { registry = "https://pypi.org/simple" }
|
| 208 |
+
dependencies = [
|
| 209 |
+
{ name = "fla-core" },
|
| 210 |
+
{ name = "transformers" },
|
| 211 |
+
]
|
| 212 |
+
sdist = { url = "https://files.pythonhosted.org/packages/d2/76/c180949eae5161b9fcf4c928cab52f0c257ce84c1a59b4462b1d2b6e5883/flash_linear_attention-0.5.2.tar.gz", hash = "sha256:c053d3a75c8f5b725063f719ae6bce0f4d9dac6da32735be8ae7d485a6c9820f", size = 208110, upload-time = "2026-07-27T18:26:20.536Z" }
|
| 213 |
+
wheels = [
|
| 214 |
+
{ url = "https://files.pythonhosted.org/packages/90/d2/2070e3cf2148c5cce99ca4876633c4b7b89ec085323600bd3d47aeacd306/flash_linear_attention-0.5.2-py3-none-any.whl", hash = "sha256:dcf405d81f5426393b59037097aa700d0f4a841465d5028d5aa543f4502f2400", size = 399590, upload-time = "2026-07-27T18:26:17.912Z" },
|
| 215 |
+
]
|
| 216 |
+
|
| 217 |
+
[[package]]
|
| 218 |
+
name = "fsspec"
|
| 219 |
+
version = "2026.9.0"
|
| 220 |
+
source = { registry = "https://pypi.org/simple" }
|
| 221 |
+
sdist = { url = "https://files.pythonhosted.org/packages/77/cd/9be253869fc42e764de7f3dedd6969af7d44ff9c3375214a3442a6f3fc08/fsspec-2026.9.0.tar.gz", hash = "sha256:0f08147951c8cb31d844c3547d631053b127863b60be04cf06e121333ee0e2fe", size = 333545, upload-time = "2026-09-18T17:50:42.825Z" }
|
| 222 |
+
wheels = [
|
| 223 |
+
{ url = "https://files.pythonhosted.org/packages/6c/c0/a98505f18594f1bce828bb159cec0fcf9860562f1a2c85913409fc8f3d9e/fsspec-2026.9.0-py3-none-any.whl", hash = "sha256:8dd6e646e99ea382bd85f97a45e6b526a442d79423a7dc673f1e2756d05fcb5f", size = 221738, upload-time = "2026-09-18T17:50:41.341Z" },
|
| 224 |
+
]
|
| 225 |
+
|
| 226 |
+
[[package]]
|
| 227 |
+
name = "h11"
|
| 228 |
+
version = "0.16.0"
|
| 229 |
+
source = { registry = "https://pypi.org/simple" }
|
| 230 |
+
sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
|
| 231 |
+
wheels = [
|
| 232 |
+
{ url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
|
| 233 |
+
]
|
| 234 |
+
|
| 235 |
+
[[package]]
|
| 236 |
+
name = "hf-xet"
|
| 237 |
+
version = "1.6.0"
|
| 238 |
+
source = { registry = "https://pypi.org/simple" }
|
| 239 |
+
sdist = { url = "https://files.pythonhosted.org/packages/1b/ab/522a2ab67f27971a9d48ca666d4fca85ef7d5282d142e31fd087e27b1bbe/hf_xet-1.6.0.tar.gz", hash = "sha256:2e58454a340b3556dfa4972d5451aff4fba8dd42a236600ba1a1d2b1514f0fef", size = 920527, upload-time = "2026-08-03T22:33:13.243Z" }
|
| 240 |
+
wheels = [
|
| 241 |
+
{ url = "https://files.pythonhosted.org/packages/67/4e/a28359bf1c1ecf11eba22123168c138698f7cb576ac678f5a2e16cd5da08/hf_xet-1.6.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d62671bb130879cef0ee4c9ebe47a14af6c66ec53e6d84dc15936e5ffdfac82f", size = 4464663, upload-time = "2026-08-03T22:33:03.802Z" },
|
| 242 |
+
{ url = "https://files.pythonhosted.org/packages/ab/5f/311725e2a905534dfee2dcb5b08414f249147f1f12252bfc2bd24caa075c/hf_xet-1.6.0-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:8fb4f71cba6129110c3374a33f919001ff130488fc23553698e34cc1c2a1198c", size = 4675937, upload-time = "2026-08-03T22:33:08.616Z" },
|
| 243 |
+
]
|
| 244 |
+
|
| 245 |
+
[[package]]
|
| 246 |
+
name = "httpcore"
|
| 247 |
+
version = "1.0.9"
|
| 248 |
+
source = { registry = "https://pypi.org/simple" }
|
| 249 |
+
dependencies = [
|
| 250 |
+
{ name = "certifi" },
|
| 251 |
+
{ name = "h11" },
|
| 252 |
+
]
|
| 253 |
+
sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" }
|
| 254 |
+
wheels = [
|
| 255 |
+
{ url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" },
|
| 256 |
+
]
|
| 257 |
+
|
| 258 |
+
[[package]]
|
| 259 |
+
name = "httpx"
|
| 260 |
+
version = "0.28.1"
|
| 261 |
+
source = { registry = "https://pypi.org/simple" }
|
| 262 |
+
dependencies = [
|
| 263 |
+
{ name = "anyio" },
|
| 264 |
+
{ name = "certifi" },
|
| 265 |
+
{ name = "httpcore" },
|
| 266 |
+
{ name = "idna" },
|
| 267 |
+
]
|
| 268 |
+
sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" }
|
| 269 |
+
wheels = [
|
| 270 |
+
{ url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" },
|
| 271 |
+
]
|
| 272 |
+
|
| 273 |
+
[[package]]
|
| 274 |
+
name = "huggingface-hub"
|
| 275 |
+
version = "1.33.0"
|
| 276 |
+
source = { registry = "https://pypi.org/simple" }
|
| 277 |
+
dependencies = [
|
| 278 |
+
{ name = "click" },
|
| 279 |
+
{ name = "filelock" },
|
| 280 |
+
{ name = "fsspec" },
|
| 281 |
+
{ name = "hf-xet" },
|
| 282 |
+
{ name = "httpx" },
|
| 283 |
+
{ name = "packaging" },
|
| 284 |
+
{ name = "pyyaml" },
|
| 285 |
+
{ name = "tqdm" },
|
| 286 |
+
{ name = "typing-extensions" },
|
| 287 |
+
]
|
| 288 |
+
sdist = { url = "https://files.pythonhosted.org/packages/25/2a/484d112c0d8fc5f665d7b65137ac9cdb2953c982391598c3597968a12ee7/huggingface_hub-1.33.0.tar.gz", hash = "sha256:367be21a201db9523eddf8aeac7048f2602c1b308691c97640d5e72ed188007e", size = 1043548, upload-time = "2026-09-24T09:49:29.971Z" }
|
| 289 |
+
wheels = [
|
| 290 |
+
{ url = "https://files.pythonhosted.org/packages/fc/16/963096d224b80909432dc16561a615fd33d2d13beef3ce4c63fa25e40867/huggingface_hub-1.33.0-py3-none-any.whl", hash = "sha256:04e434b06e100eddbce9a6e817d72693a7884b10a79bd67ab48080d5c07eb899", size = 846435, upload-time = "2026-09-24T09:49:28.059Z" },
|
| 291 |
+
]
|
| 292 |
+
|
| 293 |
+
[[package]]
|
| 294 |
+
name = "idna"
|
| 295 |
+
version = "3.20"
|
| 296 |
+
source = { registry = "https://pypi.org/simple" }
|
| 297 |
+
sdist = { url = "https://files.pythonhosted.org/packages/f5/08/8eea9d4b8302028f3abb2c0813953f7aec26d33b7a8960ed760e65ff29fa/idna-3.20.tar.gz", hash = "sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44", size = 216463, upload-time = "2026-09-17T14:11:04.752Z" }
|
| 298 |
+
wheels = [
|
| 299 |
+
{ url = "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", size = 69583, upload-time = "2026-09-17T14:11:03.168Z" },
|
| 300 |
+
]
|
| 301 |
+
|
| 302 |
+
[[package]]
|
| 303 |
+
name = "jinja2"
|
| 304 |
+
version = "3.1.6"
|
| 305 |
+
source = { registry = "https://pypi.org/simple" }
|
| 306 |
+
dependencies = [
|
| 307 |
+
{ name = "markupsafe" },
|
| 308 |
+
]
|
| 309 |
+
sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }
|
| 310 |
+
wheels = [
|
| 311 |
+
{ url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
|
| 312 |
+
]
|
| 313 |
+
|
| 314 |
+
[[package]]
|
| 315 |
+
name = "markdown-it-py"
|
| 316 |
+
version = "4.2.0"
|
| 317 |
+
source = { registry = "https://pypi.org/simple" }
|
| 318 |
+
dependencies = [
|
| 319 |
+
{ name = "mdurl" },
|
| 320 |
+
]
|
| 321 |
+
sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" }
|
| 322 |
+
wheels = [
|
| 323 |
+
{ url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" },
|
| 324 |
+
]
|
| 325 |
+
|
| 326 |
+
[[package]]
|
| 327 |
+
name = "markupsafe"
|
| 328 |
+
version = "3.0.4"
|
| 329 |
+
source = { registry = "https://pypi.org/simple" }
|
| 330 |
+
sdist = { url = "https://files.pythonhosted.org/packages/38/9b/e422a865e1d5d57d0e509b4e0bf1c1a70a7f6382c29a5aa428df994c8bc8/markupsafe-3.0.4.tar.gz", hash = "sha256:2e9ad7dd851bf45fab9f75cbff4cb493fee9979e8d8c7c9c3ee119022518edd6", size = 153777, upload-time = "2026-10-02T23:07:22.29Z" }
|
| 331 |
+
wheels = [
|
| 332 |
+
{ url = "https://files.pythonhosted.org/packages/ed/85/ea548dc013962eb73653124bc595635fbf9e0fa41d1f181a967ccb784dfb/markupsafe-3.0.4-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:7a83aa6e4805df46fed18e989d3d16f86ef60cb50bbc8d9ce3a6be89165fbf6e", size = 11443, upload-time = "2026-10-02T23:05:12.887Z" },
|
| 333 |
+
{ url = "https://files.pythonhosted.org/packages/63/e0/cec6865dfe88cb48fedd4b20aed6af5158e41092adcbf3e028bcc6ec2108/markupsafe-3.0.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:434139499bb20b502ed3baa1f169e618f924a97e7a777fea1a49446d80106cf6", size = 23017, upload-time = "2026-10-02T23:05:19.286Z" },
|
| 334 |
+
{ url = "https://files.pythonhosted.org/packages/ab/5f/801ce02a02e7aee0f784b1ec7843026178f6adeb9c93ac67eb1992a9a84d/markupsafe-3.0.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2628d3a8cb648ecebb3c5d6b0a1052d400e4d8b7ac0fb786be8d285b50040d17", size = 23076, upload-time = "2026-10-02T23:05:26.423Z" },
|
| 335 |
+
]
|
| 336 |
+
|
| 337 |
+
[[package]]
|
| 338 |
+
name = "mdurl"
|
| 339 |
+
version = "0.1.2"
|
| 340 |
+
source = { registry = "https://pypi.org/simple" }
|
| 341 |
+
sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }
|
| 342 |
+
wheels = [
|
| 343 |
+
{ url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },
|
| 344 |
+
]
|
| 345 |
+
|
| 346 |
+
[[package]]
|
| 347 |
+
name = "mpmath"
|
| 348 |
+
version = "1.3.0"
|
| 349 |
+
source = { registry = "https://pypi.org/simple" }
|
| 350 |
+
sdist = { url = "https://files.pythonhosted.org/packages/e0/47/dd32fa426cc72114383ac549964eecb20ecfd886d1e5ccf5340b55b02f57/mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f", size = 508106, upload-time = "2023-03-07T16:47:11.061Z" }
|
| 351 |
+
wheels = [
|
| 352 |
+
{ url = "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c", size = 536198, upload-time = "2023-03-07T16:47:09.197Z" },
|
| 353 |
+
]
|
| 354 |
+
|
| 355 |
+
[[package]]
|
| 356 |
+
name = "networkx"
|
| 357 |
+
version = "3.7"
|
| 358 |
+
source = { registry = "https://pypi.org/simple" }
|
| 359 |
+
sdist = { url = "https://files.pythonhosted.org/packages/dc/76/3af777226b63a5e64a6b36b1ec5855c14e2b94a37096d4760e595fc43511/networkx-3.7.tar.gz", hash = "sha256:fd77a511bd90f39f3d016351345b52cf5319b813bdca01de3f755d3cca62e96a", size = 1866482, upload-time = "2026-09-21T16:45:16.974Z" }
|
| 360 |
+
wheels = [
|
| 361 |
+
{ url = "https://files.pythonhosted.org/packages/7e/cd/fe58041e9011f307c490e3e17dd48cc516448f7c698a3f2d9d9d65d7e6a8/networkx-3.7-py3-none-any.whl", hash = "sha256:e3fd2c13a7814cee3746340d8d7f8598a67f16a58bf47fb7f8793fab6efca1b0", size = 2142205, upload-time = "2026-09-21T16:45:14.609Z" },
|
| 362 |
+
]
|
| 363 |
+
|
| 364 |
+
[[package]]
|
| 365 |
+
name = "ninja"
|
| 366 |
+
version = "1.13.2"
|
| 367 |
+
source = { registry = "https://pypi.org/simple" }
|
| 368 |
+
sdist = { url = "https://files.pythonhosted.org/packages/ac/92/410b7917d16ab54c04b05cc32b9284803671d91cf79d33be6009c28d4ea8/ninja-1.13.2.tar.gz", hash = "sha256:525bfa3fc88aa30a4467df270fd5be6f9fcae8061d54d4df74ea1dc5abd5a975", size = 243739, upload-time = "2026-08-30T15:49:51.897Z" }
|
| 369 |
+
wheels = [
|
| 370 |
+
{ url = "https://files.pythonhosted.org/packages/6e/53/ebfed7b689c338dd8ebeec9c0730c8d56821292f14e2536e5f3ef1a05744/ninja-1.13.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:65a24341b5ac09fcadcc37082660be40a94174e51a937fabf6e2cae26225fa2c", size = 183365, upload-time = "2026-08-30T15:49:34.53Z" },
|
| 371 |
+
{ url = "https://files.pythonhosted.org/packages/f5/5f/c511f2952f94ab2966d60edd9c34e744ea32f2724b1184b62270bde55b3a/ninja-1.13.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:915bd482c4be41c75120fd67a22e0bb3f0fbb3bbc5f95b89787deadd59e27ef2", size = 544460, upload-time = "2026-08-30T15:49:46.29Z" },
|
| 372 |
+
]
|
| 373 |
+
|
| 374 |
+
[[package]]
|
| 375 |
+
name = "numpy"
|
| 376 |
+
version = "2.5.3"
|
| 377 |
+
source = { registry = "https://pypi.org/simple" }
|
| 378 |
+
sdist = { url = "https://files.pythonhosted.org/packages/13/01/11703282db468b85f6f7b8c7f22d058de5970d5c7e60a3a8aaa313c3de36/numpy-2.5.3.tar.gz", hash = "sha256:df2d5874ff183595a4ba404edd04f6bd9b5505c1d7708573f6a6c17489a67563", size = 20791231, upload-time = "2026-09-06T16:27:47.073Z" }
|
| 379 |
+
wheels = [
|
| 380 |
+
{ url = "https://files.pythonhosted.org/packages/3a/1b/3b16a9bc514a440a7a0883684111dcb1ef1aee960af2ca95da8fc775f124/numpy-2.5.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a5fa86b80fd24bcd1aff83ad23be44ea323de3f787be8f8b15d4a65621e25321", size = 16708577, upload-time = "2026-09-06T16:25:14.171Z" },
|
| 381 |
+
{ url = "https://files.pythonhosted.org/packages/5f/3e/a700ecbf36e85ae8328fd3b0e12eeddc22ed6358a64cb2bd913e0d195d65/numpy-2.5.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1302b90c0e52281681b2975adfe8a860cb7b12216a27b4b0b4207c44bf7bccf0", size = 18465724, upload-time = "2026-09-06T16:25:20.949Z" },
|
| 382 |
+
]
|
| 383 |
+
|
| 384 |
+
[[package]]
|
| 385 |
+
name = "nvidia-cublas-cu12"
|
| 386 |
+
version = "12.8.4.1"
|
| 387 |
+
source = { registry = "https://pypi.org/simple" }
|
| 388 |
+
wheels = [
|
| 389 |
+
{ url = "https://files.pythonhosted.org/packages/dc/61/e24b560ab2e2eaeb3c839129175fb330dfcfc29e5203196e5541a4c44682/nvidia_cublas_cu12-12.8.4.1-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:8ac4e771d5a348c551b2a426eda6193c19aa630236b418086020df5ba9667142", size = 594346921, upload-time = "2025-03-07T01:44:31.254Z" },
|
| 390 |
+
]
|
| 391 |
+
|
| 392 |
+
[[package]]
|
| 393 |
+
name = "nvidia-cuda-cupti-cu12"
|
| 394 |
+
version = "12.8.90"
|
| 395 |
+
source = { registry = "https://pypi.org/simple" }
|
| 396 |
+
wheels = [
|
| 397 |
+
{ url = "https://files.pythonhosted.org/packages/f8/02/2adcaa145158bf1a8295d83591d22e4103dbfd821bcaf6f3f53151ca4ffa/nvidia_cuda_cupti_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ea0cb07ebda26bb9b29ba82cda34849e73c166c18162d3913575b0c9db9a6182", size = 10248621, upload-time = "2025-03-07T01:40:21.213Z" },
|
| 398 |
+
]
|
| 399 |
+
|
| 400 |
+
[[package]]
|
| 401 |
+
name = "nvidia-cuda-nvrtc-cu12"
|
| 402 |
+
version = "12.8.93"
|
| 403 |
+
source = { registry = "https://pypi.org/simple" }
|
| 404 |
+
wheels = [
|
| 405 |
+
{ url = "https://files.pythonhosted.org/packages/05/6b/32f747947df2da6994e999492ab306a903659555dddc0fbdeb9d71f75e52/nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl", hash = "sha256:a7756528852ef889772a84c6cd89d41dfa74667e24cca16bb31f8f061e3e9994", size = 88040029, upload-time = "2025-03-07T01:42:13.562Z" },
|
| 406 |
+
]
|
| 407 |
+
|
| 408 |
+
[[package]]
|
| 409 |
+
name = "nvidia-cuda-runtime-cu12"
|
| 410 |
+
version = "12.8.90"
|
| 411 |
+
source = { registry = "https://pypi.org/simple" }
|
| 412 |
+
wheels = [
|
| 413 |
+
{ url = "https://files.pythonhosted.org/packages/0d/9b/a997b638fcd068ad6e4d53b8551a7d30fe8b404d6f1804abf1df69838932/nvidia_cuda_runtime_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:adade8dcbd0edf427b7204d480d6066d33902cab2a4707dcfc48a2d0fd44ab90", size = 954765, upload-time = "2025-03-07T01:40:01.615Z" },
|
| 414 |
+
]
|
| 415 |
+
|
| 416 |
+
[[package]]
|
| 417 |
+
name = "nvidia-cudnn-cu12"
|
| 418 |
+
version = "9.19.0.56"
|
| 419 |
+
source = { registry = "https://pypi.org/simple" }
|
| 420 |
+
dependencies = [
|
| 421 |
+
{ name = "nvidia-cublas-cu12" },
|
| 422 |
+
]
|
| 423 |
+
wheels = [
|
| 424 |
+
{ url = "https://files.pythonhosted.org/packages/c5/41/65225d42fba06fb3dd3972485ea258e7dd07a40d6e01c95da6766ad87354/nvidia_cudnn_cu12-9.19.0.56-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:ac6ad90a075bb33a94f2b4cf4622eac13dd4dc65cf6dd9c7572a318516a36625", size = 657906812, upload-time = "2026-02-03T20:44:12.638Z" },
|
| 425 |
+
]
|
| 426 |
+
|
| 427 |
+
[[package]]
|
| 428 |
+
name = "nvidia-cufft-cu12"
|
| 429 |
+
version = "11.3.3.83"
|
| 430 |
+
source = { registry = "https://pypi.org/simple" }
|
| 431 |
+
dependencies = [
|
| 432 |
+
{ name = "nvidia-nvjitlink-cu12" },
|
| 433 |
+
]
|
| 434 |
+
wheels = [
|
| 435 |
+
{ url = "https://files.pythonhosted.org/packages/1f/13/ee4e00f30e676b66ae65b4f08cb5bcbb8392c03f54f2d5413ea99a5d1c80/nvidia_cufft_cu12-11.3.3.83-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4d2dd21ec0b88cf61b62e6b43564355e5222e4a3fb394cac0db101f2dd0d4f74", size = 193118695, upload-time = "2025-03-07T01:45:27.821Z" },
|
| 436 |
+
]
|
| 437 |
+
|
| 438 |
+
[[package]]
|
| 439 |
+
name = "nvidia-cufile-cu12"
|
| 440 |
+
version = "1.13.1.3"
|
| 441 |
+
source = { registry = "https://pypi.org/simple" }
|
| 442 |
+
wheels = [
|
| 443 |
+
{ url = "https://files.pythonhosted.org/packages/bb/fe/1bcba1dfbfb8d01be8d93f07bfc502c93fa23afa6fd5ab3fc7c1df71038a/nvidia_cufile_cu12-1.13.1.3-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1d069003be650e131b21c932ec3d8969c1715379251f8d23a1860554b1cb24fc", size = 1197834, upload-time = "2025-03-07T01:45:50.723Z" },
|
| 444 |
+
]
|
| 445 |
+
|
| 446 |
+
[[package]]
|
| 447 |
+
name = "nvidia-curand-cu12"
|
| 448 |
+
version = "10.3.9.90"
|
| 449 |
+
source = { registry = "https://pypi.org/simple" }
|
| 450 |
+
wheels = [
|
| 451 |
+
{ url = "https://files.pythonhosted.org/packages/fb/aa/6584b56dc84ebe9cf93226a5cde4d99080c8e90ab40f0c27bda7a0f29aa1/nvidia_curand_cu12-10.3.9.90-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:b32331d4f4df5d6eefa0554c565b626c7216f87a06a4f56fab27c3b68a830ec9", size = 63619976, upload-time = "2025-03-07T01:46:23.323Z" },
|
| 452 |
+
]
|
| 453 |
+
|
| 454 |
+
[[package]]
|
| 455 |
+
name = "nvidia-cusolver-cu12"
|
| 456 |
+
version = "11.7.3.90"
|
| 457 |
+
source = { registry = "https://pypi.org/simple" }
|
| 458 |
+
dependencies = [
|
| 459 |
+
{ name = "nvidia-cublas-cu12" },
|
| 460 |
+
{ name = "nvidia-cusparse-cu12" },
|
| 461 |
+
{ name = "nvidia-nvjitlink-cu12" },
|
| 462 |
+
]
|
| 463 |
+
wheels = [
|
| 464 |
+
{ url = "https://files.pythonhosted.org/packages/85/48/9a13d2975803e8cf2777d5ed57b87a0b6ca2cc795f9a4f59796a910bfb80/nvidia_cusolver_cu12-11.7.3.90-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:4376c11ad263152bd50ea295c05370360776f8c3427b30991df774f9fb26c450", size = 267506905, upload-time = "2025-03-07T01:47:16.273Z" },
|
| 465 |
+
]
|
| 466 |
+
|
| 467 |
+
[[package]]
|
| 468 |
+
name = "nvidia-cusparse-cu12"
|
| 469 |
+
version = "12.5.8.93"
|
| 470 |
+
source = { registry = "https://pypi.org/simple" }
|
| 471 |
+
dependencies = [
|
| 472 |
+
{ name = "nvidia-nvjitlink-cu12" },
|
| 473 |
+
]
|
| 474 |
+
wheels = [
|
| 475 |
+
{ url = "https://files.pythonhosted.org/packages/c2/f5/e1854cb2f2bcd4280c44736c93550cc300ff4b8c95ebe370d0aa7d2b473d/nvidia_cusparse_cu12-12.5.8.93-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1ec05d76bbbd8b61b06a80e1eaf8cf4959c3d4ce8e711b65ebd0443bb0ebb13b", size = 288216466, upload-time = "2025-03-07T01:48:13.779Z" },
|
| 476 |
+
]
|
| 477 |
+
|
| 478 |
+
[[package]]
|
| 479 |
+
name = "nvidia-cusparselt-cu12"
|
| 480 |
+
version = "0.7.1"
|
| 481 |
+
source = { registry = "https://pypi.org/simple" }
|
| 482 |
+
wheels = [
|
| 483 |
+
{ url = "https://files.pythonhosted.org/packages/56/79/12978b96bd44274fe38b5dde5cfb660b1d114f70a65ef962bcbbed99b549/nvidia_cusparselt_cu12-0.7.1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:f1bb701d6b930d5a7cea44c19ceb973311500847f81b634d802b7b539dc55623", size = 287193691, upload-time = "2025-02-26T00:15:44.104Z" },
|
| 484 |
+
]
|
| 485 |
+
|
| 486 |
+
[[package]]
|
| 487 |
+
name = "nvidia-nccl-cu12"
|
| 488 |
+
version = "2.28.9"
|
| 489 |
+
source = { registry = "https://pypi.org/simple" }
|
| 490 |
+
wheels = [
|
| 491 |
+
{ url = "https://files.pythonhosted.org/packages/4a/4e/44dbb46b3d1b0ec61afda8e84837870f2f9ace33c564317d59b70bc19d3e/nvidia_nccl_cu12-2.28.9-py3-none-manylinux_2_18_x86_64.whl", hash = "sha256:485776daa8447da5da39681af455aa3b2c2586ddcf4af8772495e7c532c7e5ab", size = 296782137, upload-time = "2025-11-18T05:49:34.248Z" },
|
| 492 |
+
]
|
| 493 |
+
|
| 494 |
+
[[package]]
|
| 495 |
+
name = "nvidia-nvjitlink-cu12"
|
| 496 |
+
version = "12.8.93"
|
| 497 |
+
source = { registry = "https://pypi.org/simple" }
|
| 498 |
+
wheels = [
|
| 499 |
+
{ url = "https://files.pythonhosted.org/packages/f6/74/86a07f1d0f42998ca31312f998bd3b9a7eff7f52378f4f270c8679c77fb9/nvidia_nvjitlink_cu12-12.8.93-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl", hash = "sha256:81ff63371a7ebd6e6451970684f916be2eab07321b73c9d244dc2b4da7f73b88", size = 39254836, upload-time = "2025-03-07T01:49:55.661Z" },
|
| 500 |
+
]
|
| 501 |
+
|
| 502 |
+
[[package]]
|
| 503 |
+
name = "nvidia-nvshmem-cu12"
|
| 504 |
+
version = "3.4.5"
|
| 505 |
+
source = { registry = "https://pypi.org/simple" }
|
| 506 |
+
wheels = [
|
| 507 |
+
{ url = "https://files.pythonhosted.org/packages/b5/09/6ea3ea725f82e1e76684f0708bbedd871fc96da89945adeba65c3835a64c/nvidia_nvshmem_cu12-3.4.5-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:042f2500f24c021db8a06c5eec2539027d57460e1c1a762055a6554f72c369bd", size = 139103095, upload-time = "2025-09-06T00:32:31.266Z" },
|
| 508 |
+
]
|
| 509 |
+
|
| 510 |
+
[[package]]
|
| 511 |
+
name = "nvidia-nvtx-cu12"
|
| 512 |
+
version = "12.8.90"
|
| 513 |
+
source = { registry = "https://pypi.org/simple" }
|
| 514 |
+
wheels = [
|
| 515 |
+
{ url = "https://files.pythonhosted.org/packages/a2/eb/86626c1bbc2edb86323022371c39aa48df6fd8b0a1647bc274577f72e90b/nvidia_nvtx_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5b17e2001cc0d751a5bc2c6ec6d26ad95913324a4adb86788c944f8ce9ba441f", size = 89954, upload-time = "2025-03-07T01:42:44.131Z" },
|
| 516 |
+
]
|
| 517 |
+
|
| 518 |
+
[[package]]
|
| 519 |
+
name = "packaging"
|
| 520 |
+
version = "26.3"
|
| 521 |
+
source = { registry = "https://pypi.org/simple" }
|
| 522 |
+
sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" }
|
| 523 |
+
wheels = [
|
| 524 |
+
{ url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" },
|
| 525 |
+
]
|
| 526 |
+
|
| 527 |
+
[[package]]
|
| 528 |
+
name = "peft"
|
| 529 |
+
version = "0.21.0"
|
| 530 |
+
source = { registry = "https://pypi.org/simple" }
|
| 531 |
+
dependencies = [
|
| 532 |
+
{ name = "accelerate" },
|
| 533 |
+
{ name = "huggingface-hub" },
|
| 534 |
+
{ name = "numpy" },
|
| 535 |
+
{ name = "packaging" },
|
| 536 |
+
{ name = "psutil" },
|
| 537 |
+
{ name = "pyyaml" },
|
| 538 |
+
{ name = "safetensors" },
|
| 539 |
+
{ name = "torch" },
|
| 540 |
+
{ name = "tqdm" },
|
| 541 |
+
{ name = "transformers" },
|
| 542 |
+
]
|
| 543 |
+
sdist = { url = "https://files.pythonhosted.org/packages/4f/91/56cc2b1b6824f5a4026750274240f26cd23465fb1a29cd14772d555433f2/peft-0.21.0.tar.gz", hash = "sha256:17f2b5a264439f4cd983c02e95954f2e948e3bcb85f75895ee307f94a55fd28f", size = 978334, upload-time = "2026-09-15T13:34:02.583Z" }
|
| 544 |
+
wheels = [
|
| 545 |
+
{ url = "https://files.pythonhosted.org/packages/13/f0/29c37002f5ef5cb5be54890114d5c8f726f0cb5072a8ba0880758c912bfd/peft-0.21.0-py3-none-any.whl", hash = "sha256:b64eb75fd9dece7401c70e675b8d9de024993b70483691b41c62876f0c7809b7", size = 832883, upload-time = "2026-09-15T13:33:59.775Z" },
|
| 546 |
+
]
|
| 547 |
+
|
| 548 |
+
[[package]]
|
| 549 |
+
name = "pillow"
|
| 550 |
+
version = "12.1.1"
|
| 551 |
+
source = { registry = "https://pypi.org/simple" }
|
| 552 |
+
sdist = { url = "https://files.pythonhosted.org/packages/1f/42/5c74462b4fd957fcd7b13b04fb3205ff8349236ea74c7c375766d6c82288/pillow-12.1.1.tar.gz", hash = "sha256:9ad8fa5937ab05218e2b6a4cff30295ad35afd2f83ac592e68c0d871bb0fdbc4", size = 46980264, upload-time = "2026-02-11T04:23:07.146Z" }
|
| 553 |
+
wheels = [
|
| 554 |
+
{ url = "https://files.pythonhosted.org/packages/a0/c6/d5eb6a4fb32a3f9c21a8c7613ec706534ea1cf9f4b3663e99f0d83f6fca8/pillow-12.1.1-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:e65498daf4b583091ccbb2556c7000abf0f3349fcd57ef7adc9a84a394ed29f6", size = 3601364, upload-time = "2026-02-11T04:21:10.194Z" },
|
| 555 |
+
{ url = "https://files.pythonhosted.org/packages/95/f4/86f51b8745070daf21fd2e5b1fe0eb35d4db9ca26e6d58366562fb56a743/pillow-12.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fc44ef1f3de4f45b50ccf9136999d71abb99dca7706bc75d222ed350b9fd2289", size = 8041706, upload-time = "2026-02-11T04:21:17.723Z" },
|
| 556 |
+
{ url = "https://files.pythonhosted.org/packages/71/24/538bff45bde96535d7d998c6fed1a751c75ac7c53c37c90dc2601b243893/pillow-12.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:47b94983da0c642de92ced1702c5b6c292a84bd3a8e1d1702ff923f183594717", size = 7038069, upload-time = "2026-02-11T04:21:21.378Z" },
|
| 557 |
+
{ url = "https://files.pythonhosted.org/packages/6c/57/9045cb3ff11eeb6c1adce3b2d60d7d299d7b273a2e6c8381a524abfdc474/pillow-12.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a550ae29b95c6dc13cf69e2c9dc5747f814c54eeb2e32d683e5e93af56caa029", size = 7164523, upload-time = "2026-02-11T04:21:25.01Z" },
|
| 558 |
+
{ url = "https://files.pythonhosted.org/packages/3d/1d/6d875422c9f28a4a361f495a5f68d9de4a66941dc2c619103ca335fa6446/pillow-12.1.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:691ab2ac363b8217f7d31b3497108fb1f50faab2f75dfb03284ec2f217e87bf8", size = 8073226, upload-time = "2026-02-11T04:21:38.585Z" },
|
| 559 |
+
{ url = "https://files.pythonhosted.org/packages/7a/a9/7628f013f18f001c1b98d8fffe3452f306a70dc6aba7d931019e0492f45e/pillow-12.1.1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:472a8d7ded663e6162dafdf20015c486a7009483ca671cece7a9279b512fcb13", size = 7067129, upload-time = "2026-02-11T04:21:42.521Z" },
|
| 560 |
+
{ url = "https://files.pythonhosted.org/packages/da/0b/a877a6627dc8318fdb84e357c5e1a758c0941ab1ddffdafd231983788579/pillow-12.1.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:86172b0831b82ce4f7877f280055892b31179e1576aa00d0df3bb1bbf8c3e524", size = 7190954, upload-time = "2026-02-11T04:21:46.114Z" },
|
| 561 |
+
]
|
| 562 |
+
|
| 563 |
+
[[package]]
|
| 564 |
+
name = "pip"
|
| 565 |
+
version = "26.2.1"
|
| 566 |
+
source = { registry = "https://pypi.org/simple" }
|
| 567 |
+
sdist = { url = "https://files.pythonhosted.org/packages/ae/15/4500e320e6b101ec3b719ae85b697d9940b6cda672bc555bd6016fc60c6f/pip-26.2.1.tar.gz", hash = "sha256:f6ad667e89a1fe78046c8f13232b247200f5258d7828f3f7883d660878e0813f", size = 1848877, upload-time = "2026-08-04T22:51:14.148Z" }
|
| 568 |
+
wheels = [
|
| 569 |
+
{ url = "https://files.pythonhosted.org/packages/f3/6e/1736e5b4ae2b778ef2f81c47d797de9f891d4d8acb047a24ca37a60294dd/pip-26.2.1-py3-none-any.whl", hash = "sha256:71138adf1f4ca900cdb7d289c21b7494329f2332b6d85f0e1c42108c0384ed3e", size = 1816632, upload-time = "2026-08-04T22:51:12.472Z" },
|
| 570 |
+
]
|
| 571 |
+
|
| 572 |
+
[[package]]
|
| 573 |
+
name = "psutil"
|
| 574 |
+
version = "7.2.2"
|
| 575 |
+
source = { registry = "https://pypi.org/simple" }
|
| 576 |
+
sdist = { url = "https://files.pythonhosted.org/packages/aa/c6/d1ddf4abb55e93cebc4f2ed8b5d6dbad109ecb8d63748dd2b20ab5e57ebe/psutil-7.2.2.tar.gz", hash = "sha256:0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372", size = 493740, upload-time = "2026-01-28T18:14:54.428Z" }
|
| 577 |
+
wheels = [
|
| 578 |
+
{ url = "https://files.pythonhosted.org/packages/37/d6/246513fbf9fa174af531f28412297dd05241d97a75911ac8febefa1a53c6/psutil-7.2.2-cp313-cp313t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1a571f2330c966c62aeda00dd24620425d4b0cc86881c89861fbc04549e5dc63", size = 181476, upload-time = "2026-01-28T18:15:01.884Z" },
|
| 579 |
+
{ url = "https://files.pythonhosted.org/packages/b5/70/5d8df3b09e25bce090399cf48e452d25c935ab72dad19406c77f4e828045/psutil-7.2.2-cp36-abi3-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:076a2d2f923fd4821644f5ba89f059523da90dc9014e85f8e45a5774ca5bc6f9", size = 155560, upload-time = "2026-01-28T18:15:25.976Z" },
|
| 580 |
+
{ url = "https://files.pythonhosted.org/packages/04/78/0acd37ca84ce3ddffaa92ef0f571e073faa6d8ff1f0559ab1272188ea2be/psutil-7.2.2-cp36-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b58fabe35e80b264a4e3bb23e6b96f9e45a3df7fb7eed419ac0e5947c61e47cc", size = 148266, upload-time = "2026-01-28T18:15:31.597Z" },
|
| 581 |
+
]
|
| 582 |
+
|
| 583 |
+
[[package]]
|
| 584 |
+
name = "pygments"
|
| 585 |
+
version = "2.21.0"
|
| 586 |
+
source = { registry = "https://pypi.org/simple" }
|
| 587 |
+
sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" }
|
| 588 |
+
wheels = [
|
| 589 |
+
{ url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" },
|
| 590 |
+
]
|
| 591 |
+
|
| 592 |
+
[[package]]
|
| 593 |
+
name = "pyyaml"
|
| 594 |
+
version = "6.0.3"
|
| 595 |
+
source = { registry = "https://pypi.org/simple" }
|
| 596 |
+
sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" }
|
| 597 |
+
wheels = [
|
| 598 |
+
{ url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" },
|
| 599 |
+
{ url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" },
|
| 600 |
+
]
|
| 601 |
+
|
| 602 |
+
[[package]]
|
| 603 |
+
name = "regex"
|
| 604 |
+
version = "2026.9.29"
|
| 605 |
+
source = { registry = "https://pypi.org/simple" }
|
| 606 |
+
sdist = { url = "https://files.pythonhosted.org/packages/fc/f2/af1da9d3ceed77bfcdce40427d49ba0be94e4fe84245e3bfef68c10e75b6/regex-2026.9.29.tar.gz", hash = "sha256:8b5fcc4771732191b2b7d1dd68d8f0353f47f8d90b6150f6dce58bf1112442cb", size = 419199, upload-time = "2026-09-29T00:49:58.298Z" }
|
| 607 |
+
wheels = [
|
| 608 |
+
{ url = "https://files.pythonhosted.org/packages/9a/8e/c1ed81f55f992f6aa0b699a592a50c1ce9e6d44ff1aee2c14c0537dcef9c/regex-2026.9.29-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d49c18f1ea294cf4adde2e5ac256e98c82ea9d708462ce4bf799dffa7cfe8a2c", size = 807902, upload-time = "2026-09-29T00:47:18.268Z" },
|
| 609 |
+
{ url = "https://files.pythonhosted.org/packages/12/62/d0314bcedfd3586197e4596931fa220260eb2385bf53184e5b9ae67db24b/regex-2026.9.29-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ebb8912f565b8cdbbf27debfe00df04202c20e2f651b9e32767930c5eace3621", size = 796602, upload-time = "2026-09-29T00:47:29.233Z" },
|
| 610 |
+
]
|
| 611 |
+
|
| 612 |
+
[[package]]
|
| 613 |
+
name = "rich"
|
| 614 |
+
version = "15.0.0"
|
| 615 |
+
source = { registry = "https://pypi.org/simple" }
|
| 616 |
+
dependencies = [
|
| 617 |
+
{ name = "markdown-it-py" },
|
| 618 |
+
{ name = "pygments" },
|
| 619 |
+
]
|
| 620 |
+
sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" }
|
| 621 |
+
wheels = [
|
| 622 |
+
{ url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" },
|
| 623 |
+
]
|
| 624 |
+
|
| 625 |
+
[[package]]
|
| 626 |
+
name = "safetensors"
|
| 627 |
+
version = "0.8.0"
|
| 628 |
+
source = { registry = "https://pypi.org/simple" }
|
| 629 |
+
sdist = { url = "https://files.pythonhosted.org/packages/45/06/f955dbbb1859e3bd23c8ac6141af5106e7ad5fedec4a3a6e3d60f94b7001/safetensors-0.8.0.tar.gz", hash = "sha256:fabaf3e0f18a6618d9b36560682562157f77c2b71fcffc7b432be2baed9d753d", size = 325846, upload-time = "2026-06-09T07:52:25.563Z" }
|
| 630 |
+
wheels = [
|
| 631 |
+
{ url = "https://files.pythonhosted.org/packages/28/50/f203ff3a3ddfe19308efc83c5a3a29ed02bf786732ec35e68bf9162f3365/safetensors-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd6f3f93c9a0a7cc2788ee63fb763353d4bd2e89b0751bc78fcf7dda00bea774", size = 516040, upload-time = "2026-06-09T07:52:16.29Z" },
|
| 632 |
+
{ url = "https://files.pythonhosted.org/packages/27/43/41c1621732edd934d868a00d1b891584c892a7b62a9aab82ea5a0a5623ee/safetensors-0.8.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:8e080062fcde23be189565e1c3305d16751a218ecf9412c8601e64204eb6f846", size = 722361, upload-time = "2026-06-09T07:52:23.924Z" },
|
| 633 |
+
]
|
| 634 |
+
|
| 635 |
+
[[package]]
|
| 636 |
+
name = "setuptools"
|
| 637 |
+
version = "81.0.0"
|
| 638 |
+
source = { registry = "https://pypi.org/simple" }
|
| 639 |
+
sdist = { url = "https://files.pythonhosted.org/packages/0d/1c/73e719955c59b8e424d015ab450f51c0af856ae46ea2da83eba51cc88de1/setuptools-81.0.0.tar.gz", hash = "sha256:487b53915f52501f0a79ccfd0c02c165ffe06631443a886740b91af4b7a5845a", size = 1198299, upload-time = "2026-02-06T21:10:39.601Z" }
|
| 640 |
+
wheels = [
|
| 641 |
+
{ url = "https://files.pythonhosted.org/packages/e1/e3/c164c88b2e5ce7b24d667b9bd83589cf4f3520d97cad01534cd3c4f55fdb/setuptools-81.0.0-py3-none-any.whl", hash = "sha256:fdd925d5c5d9f62e4b74b30d6dd7828ce236fd6ed998a08d81de62ce5a6310d6", size = 1062021, upload-time = "2026-02-06T21:10:37.175Z" },
|
| 642 |
+
]
|
| 643 |
+
|
| 644 |
+
[[package]]
|
| 645 |
+
name = "shellingham"
|
| 646 |
+
version = "1.5.4"
|
| 647 |
+
source = { registry = "https://pypi.org/simple" }
|
| 648 |
+
sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" }
|
| 649 |
+
wheels = [
|
| 650 |
+
{ url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" },
|
| 651 |
+
]
|
| 652 |
+
|
| 653 |
+
[[package]]
|
| 654 |
+
name = "sympy"
|
| 655 |
+
version = "1.14.0"
|
| 656 |
+
source = { registry = "https://pypi.org/simple" }
|
| 657 |
+
dependencies = [
|
| 658 |
+
{ name = "mpmath" },
|
| 659 |
+
]
|
| 660 |
+
sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" }
|
| 661 |
+
wheels = [
|
| 662 |
+
{ url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" },
|
| 663 |
+
]
|
| 664 |
+
|
| 665 |
+
[[package]]
|
| 666 |
+
name = "tokenizers"
|
| 667 |
+
version = "0.23.2"
|
| 668 |
+
source = { registry = "https://pypi.org/simple" }
|
| 669 |
+
dependencies = [
|
| 670 |
+
{ name = "huggingface-hub" },
|
| 671 |
+
]
|
| 672 |
+
sdist = { url = "https://files.pythonhosted.org/packages/18/1e/bc6587c5ab643b2e17776cace9070a2ae73549c86bffac9934a600bf3c31/tokenizers-0.23.2.tar.gz", hash = "sha256:7f0f085686b9de0d0079e6f874ae053600db64c5d13049e0bbc0119926d25aac", size = 385745, upload-time = "2026-09-03T08:55:42.89Z" }
|
| 673 |
+
wheels = [
|
| 674 |
+
{ url = "https://files.pythonhosted.org/packages/2c/ca/ca6b93c7820df123b2662a9469e8facc826ccc94e98fdd0d615f6431e73a/tokenizers-0.23.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:41c2f84d172449b4dadb9cdc508e3e364076613c35b16e76ecfe47a60d1e3305", size = 3386843, upload-time = "2026-09-03T08:55:26.584Z" },
|
| 675 |
+
{ url = "https://files.pythonhosted.org/packages/b5/d8/8e9e4e0b287a338d8f88976729628c9d22e8a54cfaf9777018a7f7cb58a0/tokenizers-0.23.2-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:5c56bda1511921587789163e524d196ed8284174ac23abd7685d5ea8da6c4718", size = 10256304, upload-time = "2026-09-03T08:55:40.977Z" },
|
| 676 |
+
]
|
| 677 |
+
|
| 678 |
+
[[package]]
|
| 679 |
+
name = "torch"
|
| 680 |
+
version = "2.11.0+cu128"
|
| 681 |
+
source = { registry = "https://download.pytorch.org/whl/cu128" }
|
| 682 |
+
dependencies = [
|
| 683 |
+
{ name = "cuda-bindings" },
|
| 684 |
+
{ name = "cuda-toolkit", extra = ["cublas", "cudart", "cufft", "cufile", "cupti", "curand", "cusolver", "cusparse", "nvjitlink", "nvrtc", "nvtx"] },
|
| 685 |
+
{ name = "filelock" },
|
| 686 |
+
{ name = "fsspec" },
|
| 687 |
+
{ name = "jinja2" },
|
| 688 |
+
{ name = "networkx" },
|
| 689 |
+
{ name = "nvidia-cudnn-cu12" },
|
| 690 |
+
{ name = "nvidia-cusparselt-cu12" },
|
| 691 |
+
{ name = "nvidia-nccl-cu12" },
|
| 692 |
+
{ name = "nvidia-nvshmem-cu12" },
|
| 693 |
+
{ name = "setuptools" },
|
| 694 |
+
{ name = "sympy" },
|
| 695 |
+
{ name = "triton" },
|
| 696 |
+
{ name = "typing-extensions" },
|
| 697 |
+
]
|
| 698 |
+
wheels = [
|
| 699 |
+
{ url = "https://download-r2.pytorch.org/whl/cu128/torch-2.11.0%2Bcu128-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:db964b33c55035a72ab3e2162287af8f1cc276039c65d015740cc88c26dcedf7", upload-time = "2026-04-27T17:46:18Z" },
|
| 700 |
+
{ url = "https://download-r2.pytorch.org/whl/cu128/torch-2.11.0%2Bcu128-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:74b628dbc71603977b09f4e140792c6e997081a35ef3421555f3f6e201b81210", upload-time = "2026-04-27T17:50:42Z" },
|
| 701 |
+
]
|
| 702 |
+
|
| 703 |
+
[[package]]
|
| 704 |
+
name = "torchvision"
|
| 705 |
+
version = "0.26.0+cu128"
|
| 706 |
+
source = { registry = "https://download.pytorch.org/whl/cu128" }
|
| 707 |
+
dependencies = [
|
| 708 |
+
{ name = "numpy" },
|
| 709 |
+
{ name = "pillow" },
|
| 710 |
+
{ name = "torch" },
|
| 711 |
+
]
|
| 712 |
+
wheels = [
|
| 713 |
+
{ url = "https://download-r2.pytorch.org/whl/cu128/torchvision-0.26.0%2Bcu128-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:cb1f6184a7ba30fba40580e1a01a6604a86c55e79fdda187f40116ee680441ec", upload-time = "2026-03-23T15:36:22Z" },
|
| 714 |
+
{ url = "https://download-r2.pytorch.org/whl/cu128/torchvision-0.26.0%2Bcu128-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:6168abc019803ac9e97efce27eafd2fdb33db04dcc54a86039537729e5047b29", upload-time = "2026-03-23T15:36:23Z" },
|
| 715 |
+
]
|
| 716 |
+
|
| 717 |
+
[[package]]
|
| 718 |
+
name = "tqdm"
|
| 719 |
+
version = "4.70.1"
|
| 720 |
+
source = { registry = "https://pypi.org/simple" }
|
| 721 |
+
sdist = { url = "https://files.pythonhosted.org/packages/0d/ea/b2a5bd54b28a324dae8211928b2d730b6547500342c7e6c6dea08bd0a485/tqdm-4.70.1.tar.gz", hash = "sha256:cefd0eca11b2a37a3aee776544d4f4ae913f02688135b5556b8788dfa474afc4", size = 171846, upload-time = "2026-09-11T07:25:16.601Z" }
|
| 722 |
+
wheels = [
|
| 723 |
+
{ url = "https://files.pythonhosted.org/packages/a7/03/921a3d3c75785aca9ebfbfcabfbc3a1be12e2ab5265deb026d55a5a3f83e/tqdm-4.70.1-py3-none-any.whl", hash = "sha256:c293e525e6fef9c20e8728fd4612df02a0aa31bb5fe91ecd93e123b1b7bffa73", size = 80199, upload-time = "2026-09-11T07:25:14.599Z" },
|
| 724 |
+
]
|
| 725 |
+
|
| 726 |
+
[[package]]
|
| 727 |
+
name = "transformers"
|
| 728 |
+
version = "5.17.0"
|
| 729 |
+
source = { registry = "https://pypi.org/simple" }
|
| 730 |
+
dependencies = [
|
| 731 |
+
{ name = "huggingface-hub" },
|
| 732 |
+
{ name = "numpy" },
|
| 733 |
+
{ name = "packaging" },
|
| 734 |
+
{ name = "pyyaml" },
|
| 735 |
+
{ name = "regex" },
|
| 736 |
+
{ name = "safetensors" },
|
| 737 |
+
{ name = "tokenizers" },
|
| 738 |
+
{ name = "tqdm" },
|
| 739 |
+
{ name = "typer" },
|
| 740 |
+
]
|
| 741 |
+
sdist = { url = "https://files.pythonhosted.org/packages/0e/9e/750649904a065007a838981785b2bd8d9ff26154c6c341ac67d0b7f82c68/transformers-5.17.0.tar.gz", hash = "sha256:a153be279169b55b92d8000bf4af294aed684503d091cca7804da2dd8a9de000", size = 9817878, upload-time = "2026-09-09T15:39:56.886Z" }
|
| 742 |
+
wheels = [
|
| 743 |
+
{ url = "https://files.pythonhosted.org/packages/e8/d0/c502b60d684adbd98a8dc7d5bb866842772b816ac4354e4608be240041ae/transformers-5.17.0-py3-none-any.whl", hash = "sha256:78ec1ce21579b38dfb83950a0658cd119f87212a2fcfdff478096ce9d6c03801", size = 12295140, upload-time = "2026-09-09T15:39:53.746Z" },
|
| 744 |
+
]
|
| 745 |
+
|
| 746 |
+
[[package]]
|
| 747 |
+
name = "triton"
|
| 748 |
+
version = "3.6.0"
|
| 749 |
+
source = { registry = "https://pypi.org/simple" }
|
| 750 |
+
wheels = [
|
| 751 |
+
{ url = "https://files.pythonhosted.org/packages/f9/0b/37d991d8c130ce81a8728ae3c25b6e60935838e9be1b58791f5997b24a54/triton-3.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:10c7f76c6e72d2ef08df639e3d0d30729112f47a56b0c81672edc05ee5116ac9", size = 188289450, upload-time = "2026-01-20T16:00:49.136Z" },
|
| 752 |
+
{ url = "https://files.pythonhosted.org/packages/35/f8/9c66bfc55361ec6d0e4040a0337fb5924ceb23de4648b8a81ae9d33b2b38/triton-3.6.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d002e07d7180fd65e622134fbd980c9a3d4211fb85224b56a0a0efbd422ab72f", size = 188400296, upload-time = "2026-01-20T16:00:56.042Z" },
|
| 753 |
+
]
|
| 754 |
+
|
| 755 |
+
[[package]]
|
| 756 |
+
name = "typer"
|
| 757 |
+
version = "0.27.2"
|
| 758 |
+
source = { registry = "https://pypi.org/simple" }
|
| 759 |
+
dependencies = [
|
| 760 |
+
{ name = "annotated-doc" },
|
| 761 |
+
{ name = "rich" },
|
| 762 |
+
{ name = "shellingham" },
|
| 763 |
+
]
|
| 764 |
+
sdist = { url = "https://files.pythonhosted.org/packages/16/f7/57713ba479fd405eb76de31404b2c744c289e336b2d999511ebf51e496f7/typer-0.27.2.tar.gz", hash = "sha256:269b7eb9d3c202ca84b4bc9618cb04ebb43d3d4d1e567e4c768607232c05f945", size = 204045, upload-time = "2026-08-28T10:26:55.046Z" }
|
| 765 |
+
wheels = [
|
| 766 |
+
{ url = "https://files.pythonhosted.org/packages/dc/bf/205d0004930ede8f542fb58f601526fccf4ae7626075ca1e6c4de5d3d652/typer-0.27.2-py3-none-any.whl", hash = "sha256:b3a5fc4342d5fc8fda8fc3010b1cf117e9249aab7fae800c2eff62fd3842d97d", size = 123130, upload-time = "2026-08-28T10:26:53.752Z" },
|
| 767 |
+
]
|
| 768 |
+
|
| 769 |
+
[[package]]
|
| 770 |
+
name = "typing-extensions"
|
| 771 |
+
version = "4.16.0"
|
| 772 |
+
source = { registry = "https://pypi.org/simple" }
|
| 773 |
+
sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" }
|
| 774 |
+
wheels = [
|
| 775 |
+
{ url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
|
| 776 |
+
]
|
| 777 |
+
|
| 778 |
+
[[package]]
|
| 779 |
+
name = "wheel"
|
| 780 |
+
version = "0.48.0"
|
| 781 |
+
source = { registry = "https://pypi.org/simple" }
|
| 782 |
+
dependencies = [
|
| 783 |
+
{ name = "packaging" },
|
| 784 |
+
]
|
| 785 |
+
sdist = { url = "https://files.pythonhosted.org/packages/d0/20/50ed6bdf27dec98b568a8ae25dc599f35baa3d9709f9e83fd1edb56b9a90/wheel-0.48.0.tar.gz", hash = "sha256:94800765601e9171bf5d58d066e640662842bcedcbab982b2c90787a2c987322", size = 66471, upload-time = "2026-08-11T22:02:27.327Z" }
|
| 786 |
+
wheels = [
|
| 787 |
+
{ url = "https://files.pythonhosted.org/packages/2e/29/69cfbb602cd91690c55d38ba9fe53e6a7e76a6fa647bf38f19c138d25449/wheel-0.48.0-py3-none-any.whl", hash = "sha256:3217dcc807155e45db462d7ef2431f5ddda0d7273b700d05a67b271ceb1287ab", size = 33320, upload-time = "2026-08-11T22:02:26.1Z" },
|
| 788 |
+
]
|