Image-Text-to-Text
MLX
Safetensors
modilify_mk1
diffusion
multimodal
mixture-of-experts
conversational
Instructions to use modilify/Modilify-Mk1-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use modilify/Modilify-Mk1-MLX with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("modilify/Modilify-Mk1-MLX") config = load_config("modilify/Modilify-Mk1-MLX") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use modilify/Modilify-Mk1-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "modilify/Modilify-Mk1-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "modilify/Modilify-Mk1-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use modilify/Modilify-Mk1-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "modilify/Modilify-Mk1-MLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default modilify/Modilify-Mk1-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use modilify/Modilify-Mk1-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "modilify/Modilify-Mk1-MLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "modilify/Modilify-Mk1-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Reuse official Modilify Mk1 shards
Browse files- .gitattributes +2 -0
- LICENSE +125 -0
- NOTICE.md +263 -0
- assets/01-LOGO.jpg +3 -0
- chat_template.jinja +387 -0
- generation_config.json +16 -0
- model-00001-of-00011.safetensors +3 -0
- model-00002-of-00011.safetensors +3 -0
- model-00003-of-00011.safetensors +3 -0
- model-00004-of-00011.safetensors +3 -0
- model-00005-of-00011.safetensors +3 -0
- model-00006-of-00011.safetensors +3 -0
- model-00007-of-00011.safetensors +3 -0
- model-00008-of-00011.safetensors +3 -0
- model-00009-of-00011.safetensors +3 -0
- model-00010-of-00011.safetensors +3 -0
- model-00011-of-00011.safetensors +3 -0
- model.safetensors.index.json +0 -0
- processor_config.json +75 -0
- tokenizer.json +3 -0
- tokenizer_config.json +96 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ 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 |
+
assets/01-LOGO.jpg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Modilify Open Model License 1.0
|
| 2 |
+
|
| 3 |
+
Copyright 2026 Modilify
|
| 4 |
+
|
| 5 |
+
1. Definitions
|
| 6 |
+
|
| 7 |
+
"Model" means the weights, configuration, inference code, tokenizer, processor,
|
| 8 |
+
and documentation distributed with this license. "Derivative Model" means a
|
| 9 |
+
modified, fine-tuned, distilled, merged, quantized, or otherwise adapted version
|
| 10 |
+
of the Model. "You" means the individual or legal entity exercising permissions
|
| 11 |
+
under this license. "High-Risk Use" means a use that can materially affect a
|
| 12 |
+
person's safety, liberty, access to essential services, employment, housing,
|
| 13 |
+
credit, education, legal rights, or medical care, or that controls critical
|
| 14 |
+
infrastructure, weapons, or large-scale biometric surveillance.
|
| 15 |
+
|
| 16 |
+
2. Copyright Grant
|
| 17 |
+
|
| 18 |
+
Subject to this license, Modilify grants You a worldwide, perpetual,
|
| 19 |
+
non-exclusive, royalty-free, irrevocable copyright license to use, reproduce,
|
| 20 |
+
prepare derivative works of, publicly display, publicly perform, sublicense,
|
| 21 |
+
host as a service, and distribute the Model and Derivative Models, including for
|
| 22 |
+
commercial purposes.
|
| 23 |
+
|
| 24 |
+
3. Patent Grant
|
| 25 |
+
|
| 26 |
+
Each contributor grants You a worldwide, perpetual, non-exclusive, royalty-free,
|
| 27 |
+
irrevocable patent license, except as stated in this section, to make, have made,
|
| 28 |
+
use, offer to sell, sell, import, and otherwise transfer the Model where the
|
| 29 |
+
license applies only to those patent claims licensable by that contributor that
|
| 30 |
+
are necessarily infringed by that contributor's contribution alone or in
|
| 31 |
+
combination with the Model. If You institute patent litigation alleging that the
|
| 32 |
+
Model or a contribution constitutes patent infringement, patent licenses granted
|
| 33 |
+
to You under this license terminate as of the filing date.
|
| 34 |
+
|
| 35 |
+
4. Conditions on Redistribution
|
| 36 |
+
|
| 37 |
+
If You distribute the Model or a Derivative Model, You must:
|
| 38 |
+
|
| 39 |
+
a. provide recipients a copy of this license;
|
| 40 |
+
b. retain copyright, patent, attribution, and NOTICE statements;
|
| 41 |
+
c. state clearly that You modified the Model and identify material modifications;
|
| 42 |
+
d. preserve applicable third-party license and attribution notices; and
|
| 43 |
+
e. publish with the distributed model a reasonably accessible impact statement
|
| 44 |
+
describing intended uses, material limitations, evaluation scope, known
|
| 45 |
+
safety risks, and risk mitigations for the Derivative Model.
|
| 46 |
+
|
| 47 |
+
The impact statement may be maintained in a public model card or equivalent
|
| 48 |
+
document. You are not required to submit it separately to Modilify.
|
| 49 |
+
|
| 50 |
+
5. Responsible Use and High-Risk Uses
|
| 51 |
+
|
| 52 |
+
You must not use the Model or a Derivative Model:
|
| 53 |
+
|
| 54 |
+
a. to develop, operate, or materially facilitate weapons, autonomous targeting,
|
| 55 |
+
or systems intended to cause physical harm;
|
| 56 |
+
b. for unlawful mass surveillance, biometric identification without lawful
|
| 57 |
+
authority and appropriate safeguards, or social scoring that determines
|
| 58 |
+
access to rights or essential services;
|
| 59 |
+
c. to exploit children or vulnerable persons, facilitate human trafficking, or
|
| 60 |
+
generate non-consensual intimate content;
|
| 61 |
+
d. to impersonate a person or deceptively represent machine output as an
|
| 62 |
+
authentic human communication where the deception is reasonably likely to
|
| 63 |
+
cause material harm; or
|
| 64 |
+
e. to make a final decision in a High-Risk Use without meaningful qualified
|
| 65 |
+
human review, proportionate testing, monitoring, appeal or correction paths,
|
| 66 |
+
and compliance with applicable law.
|
| 67 |
+
|
| 68 |
+
Before deploying the Model in a High-Risk Use, You must perform safety and impact
|
| 69 |
+
due diligence proportionate to foreseeable harm. At minimum, document the use
|
| 70 |
+
context, evaluate relevant failure modes and affected groups, apply reasonable
|
| 71 |
+
technical and organizational safeguards, monitor material incidents, and update
|
| 72 |
+
or suspend the deployment when its residual risk is not reasonable. Research,
|
| 73 |
+
testing, auditing, and defensive safety work are permitted when conducted with
|
| 74 |
+
appropriate safeguards.
|
| 75 |
+
|
| 76 |
+
6. Trademarks
|
| 77 |
+
|
| 78 |
+
This license does not grant permission to use the trade names, trademarks,
|
| 79 |
+
service marks, or product names of Modilify or any contributor, except as needed
|
| 80 |
+
for reasonable and customary attribution or to describe the origin of the Model.
|
| 81 |
+
|
| 82 |
+
7. Third-Party Components
|
| 83 |
+
|
| 84 |
+
The Model includes or derives from third-party components identified in
|
| 85 |
+
NOTICE.md. Those components remain subject to their applicable
|
| 86 |
+
licenses and terms. In particular, rights and obligations associated with the
|
| 87 |
+
Google DiffusionGemma base are not removed, narrowed, or replaced by this
|
| 88 |
+
license. You are responsible for complying with all applicable upstream terms.
|
| 89 |
+
|
| 90 |
+
8. Termination and Reinstatement
|
| 91 |
+
|
| 92 |
+
Your rights terminate automatically if You materially violate this license and
|
| 93 |
+
do not cure the violation within 30 days after becoming aware of it. Rights are
|
| 94 |
+
reinstated upon timely cure unless a rights holder provides written notice of a
|
| 95 |
+
substantially similar repeated violation. Sections intended by their nature to
|
| 96 |
+
survive termination remain effective.
|
| 97 |
+
|
| 98 |
+
9. Disclaimer of Warranty
|
| 99 |
+
|
| 100 |
+
THE MODEL IS PROVIDED "AS IS," WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
| 101 |
+
EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF TITLE, NON-INFRINGEMENT,
|
| 102 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, OR SAFETY. YOU ARE
|
| 103 |
+
SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING
|
| 104 |
+
THE MODEL AND ASSUME ALL RISKS ASSOCIATED WITH YOUR EXERCISE OF PERMISSIONS.
|
| 105 |
+
|
| 106 |
+
10. Limitation of Liability
|
| 107 |
+
|
| 108 |
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR SHALL
|
| 109 |
+
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
| 110 |
+
CONSEQUENTIAL DAMAGES ARISING FROM THIS LICENSE OR THE USE OR INABILITY TO USE
|
| 111 |
+
THE MODEL, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, EVEN IF ADVISED OF
|
| 112 |
+
THE POSSIBILITY OF SUCH DAMAGES.
|
| 113 |
+
|
| 114 |
+
11. Governing Law and Venue
|
| 115 |
+
|
| 116 |
+
This license is governed by the laws of the State of California, excluding its
|
| 117 |
+
conflict-of-law rules. Any dispute arising from this license must be brought in
|
| 118 |
+
the state or federal courts located in Santa Clara County, California, and each
|
| 119 |
+
party consents to their personal jurisdiction and venue.
|
| 120 |
+
|
| 121 |
+
12. Entire License; Severability
|
| 122 |
+
|
| 123 |
+
This document states the complete Modilify license for the Model, subject to
|
| 124 |
+
applicable third-party terms. If a provision is unenforceable, it will be limited
|
| 125 |
+
to the minimum extent necessary and the remaining provisions remain effective.
|
NOTICE.md
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Modilify Mk1 — Notices
|
| 2 |
+
|
| 3 |
+
Copyright 2026 Modilify
|
| 4 |
+
|
| 5 |
+
This distribution is derived from `google/diffusiongemma-26B-A4B-it`, published
|
| 6 |
+
by Google DeepMind under Apache License 2.0. It retains the upstream multimodal
|
| 7 |
+
encoder, vision tower, vision projection, tokenizer, processor assets, and base
|
| 8 |
+
language-model parameters. Modilify merged the step-1000 low-rank updates and
|
| 9 |
+
added recurrent latent deliberation plus an excess-entropy
|
| 10 |
+
confidence-and-entropy commit policy.
|
| 11 |
+
|
| 12 |
+
The Modilify Open Model License 1.0 applies to Modilify's distribution and
|
| 13 |
+
original contributions. It does not erase, narrow, or replace rights and notices
|
| 14 |
+
applicable to upstream components. Users remain responsible for complying with
|
| 15 |
+
all applicable upstream terms.
|
| 16 |
+
|
| 17 |
+
- Upstream model: https://huggingface.co/google/diffusiongemma-26B-A4B-it
|
| 18 |
+
- Transformers project: https://github.com/huggingface/transformers
|
| 19 |
+
|
| 20 |
+
The remote model implementation subclasses public DiffusionGemma interfaces in
|
| 21 |
+
Hugging Face Transformers, which is also distributed under Apache License 2.0.
|
| 22 |
+
|
| 23 |
+
## Derivative Model Impact Statement Template
|
| 24 |
+
|
| 25 |
+
When distributing a derivative of Modilify Mk1, include a public impact
|
| 26 |
+
statement covering the following items. No separate submission to Modilify is
|
| 27 |
+
required.
|
| 28 |
+
|
| 29 |
+
### Identity and modifications
|
| 30 |
+
|
| 31 |
+
- Model name, version, publisher, and contact.
|
| 32 |
+
- Base version.
|
| 33 |
+
- Material modifications, data sources, merges, quantization, or adaptation.
|
| 34 |
+
|
| 35 |
+
### Intended and excluded uses
|
| 36 |
+
|
| 37 |
+
- Intended users and use cases.
|
| 38 |
+
- Explicitly excluded uses.
|
| 39 |
+
- Deployment context and degree of human oversight.
|
| 40 |
+
|
| 41 |
+
### Evaluation scope
|
| 42 |
+
|
| 43 |
+
- Evaluated capabilities and datasets.
|
| 44 |
+
- Languages, modalities, populations, or contexts not evaluated.
|
| 45 |
+
- Hardware and software used.
|
| 46 |
+
|
| 47 |
+
### Known limitations and foreseeable risks
|
| 48 |
+
|
| 49 |
+
- Reliability limitations.
|
| 50 |
+
- Safety, bias, privacy, security, and misuse risks.
|
| 51 |
+
- High-risk decisions the model must not make autonomously.
|
| 52 |
+
|
| 53 |
+
### Mitigations and monitoring
|
| 54 |
+
|
| 55 |
+
- Technical and organizational safeguards.
|
| 56 |
+
- Human review, appeal, and correction mechanisms.
|
| 57 |
+
- Monitoring, incident response, and update policy.
|
| 58 |
+
|
| 59 |
+
## Apache License 2.0
|
| 60 |
+
|
| 61 |
+
The complete license text applicable to the upstream components follows.
|
| 62 |
+
|
| 63 |
+
Apache License
|
| 64 |
+
Version 2.0, January 2004
|
| 65 |
+
http://www.apache.org/licenses/
|
| 66 |
+
|
| 67 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 68 |
+
|
| 69 |
+
1. Definitions.
|
| 70 |
+
|
| 71 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 72 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 73 |
+
|
| 74 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 75 |
+
the copyright owner that is granting the License.
|
| 76 |
+
|
| 77 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 78 |
+
other entities that control, are controlled by, or are under common
|
| 79 |
+
control with that entity. For the purposes of this definition,
|
| 80 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 81 |
+
direction or management of such entity, whether by contract or
|
| 82 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 83 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 84 |
+
|
| 85 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 86 |
+
exercising permissions granted by this License.
|
| 87 |
+
|
| 88 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 89 |
+
including but not limited to software source code, documentation
|
| 90 |
+
source, and configuration files.
|
| 91 |
+
|
| 92 |
+
"Object" form shall mean any form resulting from mechanical
|
| 93 |
+
transformation or translation of a Source form, including but
|
| 94 |
+
not limited to compiled object code, generated documentation,
|
| 95 |
+
and conversions to other media types.
|
| 96 |
+
|
| 97 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 98 |
+
Object form, made available under the License, as indicated by a
|
| 99 |
+
copyright notice that is included in or attached to the work
|
| 100 |
+
(an example is provided in the Appendix below).
|
| 101 |
+
|
| 102 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 103 |
+
form, that is based on (or derived from) the Work and for which the
|
| 104 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 105 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 106 |
+
of this License, Derivative Works shall not include works that remain
|
| 107 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 108 |
+
the Work and Derivative Works thereof.
|
| 109 |
+
|
| 110 |
+
"Contribution" shall mean any work of authorship, including
|
| 111 |
+
the original version of the Work and any modifications or additions
|
| 112 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 113 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 114 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 115 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 116 |
+
means any form of electronic, verbal, or written communication sent
|
| 117 |
+
to the Licensor or its representatives, including but not limited to
|
| 118 |
+
communication on electronic mailing lists, source code control systems,
|
| 119 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 120 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 121 |
+
excluding communication that is conspicuously marked or otherwise
|
| 122 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 123 |
+
|
| 124 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 125 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 126 |
+
subsequently incorporated within the Work.
|
| 127 |
+
|
| 128 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 129 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 130 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 131 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 132 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 133 |
+
Work and such Derivative Works in Source or Object form.
|
| 134 |
+
|
| 135 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 136 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 137 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 138 |
+
(except as stated in this section) patent license to make, have made,
|
| 139 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 140 |
+
where such license applies only to those patent claims licensable
|
| 141 |
+
by such Contributor that are necessarily infringed by their
|
| 142 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 143 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 144 |
+
institute patent litigation against any entity (including a
|
| 145 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 146 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 147 |
+
or contributory patent infringement, then any patent licenses
|
| 148 |
+
granted to You under this License for that Work shall terminate
|
| 149 |
+
as of the date such litigation is filed.
|
| 150 |
+
|
| 151 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 152 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 153 |
+
modifications, and in Source or Object form, provided that You
|
| 154 |
+
meet the following conditions:
|
| 155 |
+
|
| 156 |
+
(a) You must give any other recipients of the Work or
|
| 157 |
+
Derivative Works a copy of this License; and
|
| 158 |
+
|
| 159 |
+
(b) You must cause any modified files to carry prominent notices
|
| 160 |
+
stating that You changed the files; and
|
| 161 |
+
|
| 162 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 163 |
+
that You distribute, all copyright, patent, trademark, and
|
| 164 |
+
attribution notices from the Source form of the Work,
|
| 165 |
+
excluding those notices that do not pertain to any part of
|
| 166 |
+
the Derivative Works; and
|
| 167 |
+
|
| 168 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 169 |
+
distribution, then any Derivative Works that You distribute must
|
| 170 |
+
include a readable copy of the attribution notices contained
|
| 171 |
+
within such NOTICE file, excluding those notices that do not
|
| 172 |
+
pertain to any part of the Derivative Works, in at least one
|
| 173 |
+
of the following places: within a NOTICE text file distributed
|
| 174 |
+
as part of the Derivative Works; within the Source form or
|
| 175 |
+
documentation, if provided along with the Derivative Works; or,
|
| 176 |
+
within a display generated by the Derivative Works, if and
|
| 177 |
+
wherever such third-party notices normally appear. The contents
|
| 178 |
+
of the NOTICE file are for informational purposes only and
|
| 179 |
+
do not modify the License. You may add Your own attribution
|
| 180 |
+
notices within Derivative Works that You distribute, alongside
|
| 181 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 182 |
+
that such additional attribution notices cannot be construed
|
| 183 |
+
as modifying the License.
|
| 184 |
+
|
| 185 |
+
You may add Your own copyright statement to Your modifications and
|
| 186 |
+
may provide additional or different license terms and conditions
|
| 187 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 188 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 189 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 190 |
+
the conditions stated in this License.
|
| 191 |
+
|
| 192 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 193 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 194 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 195 |
+
this License, without any additional terms or conditions.
|
| 196 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 197 |
+
the terms of any separate license agreement you may have executed
|
| 198 |
+
with Licensor regarding such Contributions.
|
| 199 |
+
|
| 200 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 201 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 202 |
+
except as required for reasonable and customary use in describing the
|
| 203 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 204 |
+
|
| 205 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 206 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 207 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 208 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 209 |
+
implied, including, without limitation, any warranties or conditions
|
| 210 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 211 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 212 |
+
appropriateness of using or redistributing the Work and assume any
|
| 213 |
+
risks associated with Your exercise of permissions under this License.
|
| 214 |
+
|
| 215 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 216 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 217 |
+
unless required by applicable law (such as deliberate and grossly
|
| 218 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 219 |
+
liable to You for damages, including any direct, indirect, special,
|
| 220 |
+
incidental, or consequential damages of any character arising as a
|
| 221 |
+
result of this License or out of the use or inability to use the
|
| 222 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 223 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 224 |
+
other commercial damages or losses), even if such Contributor
|
| 225 |
+
has been advised of the possibility of such damages.
|
| 226 |
+
|
| 227 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 228 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 229 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 230 |
+
or other liability obligations and/or rights consistent with this
|
| 231 |
+
License. However, in accepting such obligations, You may act only
|
| 232 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 233 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 234 |
+
defend, and hold each Contributor harmless for any liability
|
| 235 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 236 |
+
of your accepting any such warranty or additional liability.
|
| 237 |
+
|
| 238 |
+
END OF TERMS AND CONDITIONS
|
| 239 |
+
|
| 240 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 241 |
+
|
| 242 |
+
To apply the Apache License to your work, attach the following
|
| 243 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 244 |
+
replaced with your own identifying information. (Don't include
|
| 245 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 246 |
+
comment syntax for the file format. We also recommend that a
|
| 247 |
+
file or class name and description of purpose be included on the
|
| 248 |
+
same "printed page" as the copyright notice for easier
|
| 249 |
+
identification within third-party archives.
|
| 250 |
+
|
| 251 |
+
Copyright [yyyy] [name of copyright owner]
|
| 252 |
+
|
| 253 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 254 |
+
you may not use this file except in compliance with the License.
|
| 255 |
+
You may obtain a copy of the License at
|
| 256 |
+
|
| 257 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 258 |
+
|
| 259 |
+
Unless required by applicable law or agreed to in writing, software
|
| 260 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 261 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 262 |
+
See the License for the specific language governing permissions and
|
| 263 |
+
limitations under the License.
|
assets/01-LOGO.jpg
ADDED
|
Git LFS Details
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{#
|
| 2 |
+
Template: Google Gemma 4 Canonical Chat Template
|
| 3 |
+
Author: Google Gemma Engineering Team
|
| 4 |
+
Published: 2026-07-09
|
| 5 |
+
Context: Fixed tool-calling loops, turn closures, and thinking content-ordering.
|
| 6 |
+
#}
|
| 7 |
+
{%- macro format_parameters(properties, required, filter_keys=false) -%}
|
| 8 |
+
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
|
| 9 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 10 |
+
{%- for key, value in properties | dictsort -%}
|
| 11 |
+
{%- set add_comma = false -%}
|
| 12 |
+
{%- if not filter_keys or key not in standard_keys -%}
|
| 13 |
+
{%- if ns.found_first %},{% endif -%}
|
| 14 |
+
{%- set ns.found_first = true -%}
|
| 15 |
+
{{ key }}:{
|
| 16 |
+
{%- if value['description'] -%}
|
| 17 |
+
description:<|"|>{{ value['description'] }}<|"|>
|
| 18 |
+
{%- set add_comma = true -%}
|
| 19 |
+
{%- endif -%}
|
| 20 |
+
{%- if value['type'] | upper == 'STRING' -%}
|
| 21 |
+
{%- if value['enum'] -%}
|
| 22 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 23 |
+
enum:{{ format_argument(value['enum']) }}
|
| 24 |
+
{%- endif -%}
|
| 25 |
+
{%- elif value['type'] | upper == 'ARRAY' -%}
|
| 26 |
+
{%- if value['items'] is mapping and value['items'] -%}
|
| 27 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 28 |
+
items:{
|
| 29 |
+
{%- set ns_items = namespace(found_first=false) -%}
|
| 30 |
+
{%- for item_key, item_value in value['items'] | dictsort -%}
|
| 31 |
+
{%- if item_value is not none -%}
|
| 32 |
+
{%- if ns_items.found_first %},{% endif -%}
|
| 33 |
+
{%- set ns_items.found_first = true -%}
|
| 34 |
+
{%- if item_key == 'properties' -%}
|
| 35 |
+
properties:{
|
| 36 |
+
{%- if item_value is mapping -%}
|
| 37 |
+
{{- format_parameters(item_value, value['items']['required'] | default([])) -}}
|
| 38 |
+
{%- endif -%}
|
| 39 |
+
}
|
| 40 |
+
{%- elif item_key == 'required' -%}
|
| 41 |
+
required:[
|
| 42 |
+
{%- for req_item in item_value -%}
|
| 43 |
+
<|"|>{{- req_item -}}<|"|>
|
| 44 |
+
{%- if not loop.last %},{% endif -%}
|
| 45 |
+
{%- endfor -%}
|
| 46 |
+
]
|
| 47 |
+
{%- elif item_key == 'type' -%}
|
| 48 |
+
{%- if item_value is string -%}
|
| 49 |
+
type:{{ format_argument(item_value | upper) }}
|
| 50 |
+
{%- else -%}
|
| 51 |
+
type:{{ format_argument(item_value | map('upper') | list) }}
|
| 52 |
+
{%- endif -%}
|
| 53 |
+
{%- else -%}
|
| 54 |
+
{{ item_key }}:{{ format_argument(item_value) }}
|
| 55 |
+
{%- endif -%}
|
| 56 |
+
{%- endif -%}
|
| 57 |
+
{%- endfor -%}
|
| 58 |
+
}
|
| 59 |
+
{%- endif -%}
|
| 60 |
+
{%- endif -%}
|
| 61 |
+
{%- if value['nullable'] %}
|
| 62 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 63 |
+
nullable:true
|
| 64 |
+
{%- endif -%}
|
| 65 |
+
{%- if value['type'] | upper == 'OBJECT' -%}
|
| 66 |
+
{%- if value['properties'] is defined and value['properties'] is mapping -%}
|
| 67 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 68 |
+
properties:{
|
| 69 |
+
{{- format_parameters(value['properties'], value['required'] | default([])) -}}
|
| 70 |
+
}
|
| 71 |
+
{%- elif value is mapping -%}
|
| 72 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 73 |
+
properties:{
|
| 74 |
+
{{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
|
| 75 |
+
}
|
| 76 |
+
{%- endif -%}
|
| 77 |
+
{%- if value['required'] -%}
|
| 78 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 79 |
+
required:[
|
| 80 |
+
{%- for item in value['required'] | default([]) -%}
|
| 81 |
+
<|"|>{{- item -}}<|"|>
|
| 82 |
+
{%- if not loop.last %},{% endif -%}
|
| 83 |
+
{%- endfor -%}
|
| 84 |
+
]
|
| 85 |
+
{%- endif -%}
|
| 86 |
+
{%- endif -%}
|
| 87 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 88 |
+
type:<|"|>{{ value['type'] | upper }}<|"|>}
|
| 89 |
+
{%- endif -%}
|
| 90 |
+
{%- endfor -%}
|
| 91 |
+
{%- endmacro -%}
|
| 92 |
+
{%- macro format_function_declaration(tool_data) -%}
|
| 93 |
+
declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
|
| 94 |
+
{%- set params = tool_data['function']['parameters'] -%}
|
| 95 |
+
{%- if params -%}
|
| 96 |
+
,parameters:{
|
| 97 |
+
{%- if params['properties'] -%}
|
| 98 |
+
properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
|
| 99 |
+
{%- endif -%}
|
| 100 |
+
{%- if params['required'] -%}
|
| 101 |
+
required:[
|
| 102 |
+
{%- for item in params['required'] -%}
|
| 103 |
+
<|"|>{{- item -}}<|"|>
|
| 104 |
+
{{- ',' if not loop.last -}}
|
| 105 |
+
{%- endfor -%}
|
| 106 |
+
],
|
| 107 |
+
{%- endif -%}
|
| 108 |
+
{%- if params['type'] -%}
|
| 109 |
+
type:<|"|>{{- params['type'] | upper -}}<|"|>}
|
| 110 |
+
{%- endif -%}
|
| 111 |
+
{%- endif -%}
|
| 112 |
+
{%- if 'response' in tool_data['function'] -%}
|
| 113 |
+
{%- set response_declaration = tool_data['function']['response'] -%}
|
| 114 |
+
,response:{
|
| 115 |
+
{%- if response_declaration['description'] -%}
|
| 116 |
+
description:<|"|>{{- response_declaration['description'] -}}<|"|>,
|
| 117 |
+
{%- endif -%}
|
| 118 |
+
{%- if response_declaration['type'] | upper == 'OBJECT' -%}
|
| 119 |
+
type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
|
| 120 |
+
{%- endif -%}
|
| 121 |
+
{%- endif -%}
|
| 122 |
+
}
|
| 123 |
+
{%- endmacro -%}
|
| 124 |
+
{%- macro format_argument(argument, escape_keys=True) -%}
|
| 125 |
+
{%- if argument is none -%}
|
| 126 |
+
{{- 'null' -}}
|
| 127 |
+
{%- elif argument is string -%}
|
| 128 |
+
{{- '<|"|>' + argument + '<|"|>' -}}
|
| 129 |
+
{%- elif argument is boolean -%}
|
| 130 |
+
{{- 'true' if argument else 'false' -}}
|
| 131 |
+
{%- elif argument is mapping -%}
|
| 132 |
+
{{- '{' -}}
|
| 133 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 134 |
+
{%- for key, value in argument | dictsort -%}
|
| 135 |
+
{%- if ns.found_first %},{% endif -%}
|
| 136 |
+
{%- set ns.found_first = true -%}
|
| 137 |
+
{%- if escape_keys -%}
|
| 138 |
+
{{- '<|"|>' + key + '<|"|>' -}}
|
| 139 |
+
{%- else -%}
|
| 140 |
+
{{- key -}}
|
| 141 |
+
{%- endif -%}
|
| 142 |
+
:{{- format_argument(value, escape_keys=escape_keys) -}}
|
| 143 |
+
{%- endfor -%}
|
| 144 |
+
{{- '}' -}}
|
| 145 |
+
{%- elif argument is sequence -%}
|
| 146 |
+
{{- '[' -}}
|
| 147 |
+
{%- for item in argument -%}
|
| 148 |
+
{{- format_argument(item, escape_keys=escape_keys) -}}
|
| 149 |
+
{%- if not loop.last %},{% endif -%}
|
| 150 |
+
{%- endfor -%}
|
| 151 |
+
{{- ']' -}}
|
| 152 |
+
{%- else -%}
|
| 153 |
+
{{- argument -}}
|
| 154 |
+
{%- endif -%}
|
| 155 |
+
{%- endmacro -%}
|
| 156 |
+
{%- macro strip_thinking(text) -%}
|
| 157 |
+
{%- set ns = namespace(result='') -%}
|
| 158 |
+
{%- for part in text.split('<channel|>') -%}
|
| 159 |
+
{%- if '<|channel>' in part -%}
|
| 160 |
+
{%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
|
| 161 |
+
{%- else -%}
|
| 162 |
+
{%- set ns.result = ns.result + part -%}
|
| 163 |
+
{%- endif -%}
|
| 164 |
+
{%- endfor -%}
|
| 165 |
+
{{- ns.result | trim -}}
|
| 166 |
+
{%- endmacro -%}
|
| 167 |
+
|
| 168 |
+
{%- macro format_tool_response_block(tool_name, response) -%}
|
| 169 |
+
{{- '<|tool_response>' -}}
|
| 170 |
+
{%- if response is mapping -%}
|
| 171 |
+
{{- 'response:' + tool_name + '{' -}}
|
| 172 |
+
{%- for key, value in response | dictsort -%}
|
| 173 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 174 |
+
{%- if not loop.last %},{% endif -%}
|
| 175 |
+
{%- endfor -%}
|
| 176 |
+
{{- '}' -}}
|
| 177 |
+
{%- else -%}
|
| 178 |
+
{{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
|
| 179 |
+
{%- endif -%}
|
| 180 |
+
{{- '<tool_response|>' -}}
|
| 181 |
+
{%- endmacro -%}
|
| 182 |
+
|
| 183 |
+
{#- ===== SETUP ===== -#}
|
| 184 |
+
{%- set ns = namespace(prev_message_type=None, prev_non_tool_role=None) -%}
|
| 185 |
+
{%- set loop_messages = messages -%}
|
| 186 |
+
{%- set enable_thinking = enable_thinking | default(false) -%}
|
| 187 |
+
{%- set preserve_thinking = preserve_thinking | default(false) -%}
|
| 188 |
+
{{- bos_token -}}
|
| 189 |
+
{#- Handle System/Tool Definitions Block -#}
|
| 190 |
+
{%- if enable_thinking or tools or (messages and messages[0]['role'] in ['system', 'developer']) -%}
|
| 191 |
+
{{- '<|turn>system\n' -}}
|
| 192 |
+
{#- Inject Thinking token at the very top of the FIRST system turn -#}
|
| 193 |
+
{%- if enable_thinking -%}
|
| 194 |
+
{{- '<|think|>\n' -}}
|
| 195 |
+
{%- set ns.prev_message_type = 'think' -%}
|
| 196 |
+
{%- endif -%}
|
| 197 |
+
{%- if messages and messages[0]['role'] in ['system', 'developer'] -%}
|
| 198 |
+
{%- if messages[0]['content'] is string -%}
|
| 199 |
+
{{- messages[0]['content'] | trim -}}
|
| 200 |
+
{%- elif messages[0]['content'] is sequence -%}
|
| 201 |
+
{%- for item in messages[0]['content'] -%}
|
| 202 |
+
{{- item['text'] | trim + ' '-}}
|
| 203 |
+
{%- endfor -%}
|
| 204 |
+
{%- endif -%}
|
| 205 |
+
{%- set loop_messages = messages[1:] -%}
|
| 206 |
+
{%- endif -%}
|
| 207 |
+
{%- if tools -%}
|
| 208 |
+
{%- for tool in tools %}
|
| 209 |
+
{{- '<|tool>' -}}
|
| 210 |
+
{{- format_function_declaration(tool) | trim -}}
|
| 211 |
+
{{- '<tool|>' -}}
|
| 212 |
+
{%- endfor %}
|
| 213 |
+
{%- set ns.prev_message_type = 'tool' -%}
|
| 214 |
+
{%- endif -%}
|
| 215 |
+
{{- '<turn|>\n' -}}
|
| 216 |
+
{%- endif %}
|
| 217 |
+
|
| 218 |
+
{#- Pre-scan: find last user message index for reasoning guard -#}
|
| 219 |
+
{%- set ns_turn = namespace(last_user_idx=-1) -%}
|
| 220 |
+
{%- for i in range(loop_messages | length) -%}
|
| 221 |
+
{%- if loop_messages[i]['role'] == 'user' -%}
|
| 222 |
+
{%- set ns_turn.last_user_idx = i -%}
|
| 223 |
+
{%- endif -%}
|
| 224 |
+
{%- endfor -%}
|
| 225 |
+
|
| 226 |
+
{#- Loop through messages -#}
|
| 227 |
+
{%- for message in loop_messages -%}
|
| 228 |
+
{%- if message['role'] != 'tool' -%}
|
| 229 |
+
{%- set ns.prev_message_type = None -%}
|
| 230 |
+
{%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
|
| 231 |
+
{#- Detect continuation using tracked state — O(1) instead of O(n) backward scan -#}
|
| 232 |
+
{%- set continue_same_model_turn = (role == 'model' and ns.prev_non_tool_role == 'assistant') -%}
|
| 233 |
+
{%- if not continue_same_model_turn -%}
|
| 234 |
+
{{- '<|turn>' + role + '\n' }}
|
| 235 |
+
|
| 236 |
+
{%- endif -%}
|
| 237 |
+
|
| 238 |
+
{#- Render reasoning/reasoning_content as thinking channel -#}
|
| 239 |
+
{%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
|
| 240 |
+
{%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or (preserve_thinking and message.get('tool_calls')) -%}
|
| 241 |
+
{%- if thinking_text and thinking_gate -%}
|
| 242 |
+
{{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
|
| 243 |
+
{%- endif -%}
|
| 244 |
+
|
| 245 |
+
{%- if message.get('tool_calls') -%}
|
| 246 |
+
{%- for tool_call in message.get('tool_calls') -%}
|
| 247 |
+
{%- set function = tool_call['function'] -%}
|
| 248 |
+
{{- '<|tool_call>call:' + function['name'] + '{' -}}
|
| 249 |
+
{%- if function['arguments'] is mapping -%}
|
| 250 |
+
{%- set ns_args = namespace(found_first=false) -%}
|
| 251 |
+
{%- for key, value in function['arguments'] | dictsort -%}
|
| 252 |
+
{%- if ns_args.found_first %},{% endif -%}
|
| 253 |
+
{%- set ns_args.found_first = true -%}
|
| 254 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 255 |
+
{%- endfor -%}
|
| 256 |
+
{%- elif function['arguments'] is none -%}
|
| 257 |
+
{%- else -%}
|
| 258 |
+
{{- raise_exception(
|
| 259 |
+
"chat_template: tool_calls[].function.arguments must be a "
|
| 260 |
+
"JSON object (mapping), not a string. Deserialize arguments "
|
| 261 |
+
"before passing to the template."
|
| 262 |
+
) -}}
|
| 263 |
+
{%- endif -%}
|
| 264 |
+
{{- '}<tool_call|>' -}}
|
| 265 |
+
{%- endfor -%}
|
| 266 |
+
{%- set ns.prev_message_type = 'tool_call' -%}
|
| 267 |
+
{%- endif -%}
|
| 268 |
+
|
| 269 |
+
{%- set ns_tr_out = namespace(flag=false) -%}
|
| 270 |
+
{%- if message.get('tool_responses') -%}
|
| 271 |
+
{#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
|
| 272 |
+
{%- for tool_response in message.get('tool_responses') -%}
|
| 273 |
+
{{- format_tool_response_block(tool_response['name'] | default('unknown', true), tool_response['response']) -}}
|
| 274 |
+
{%- set ns_tr_out.flag = true -%}
|
| 275 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 276 |
+
{%- endfor -%}
|
| 277 |
+
{%- elif message.get('tool_calls') -%}
|
| 278 |
+
{#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
|
| 279 |
+
{%- set ns_tool_scan = namespace(stopped=false) -%}
|
| 280 |
+
{%- for k in range(loop.index0 + 1, loop_messages | length) -%}
|
| 281 |
+
{%- if ns_tool_scan.stopped -%}
|
| 282 |
+
{%- elif loop_messages[k]['role'] != 'tool' -%}
|
| 283 |
+
{%- set ns_tool_scan.stopped = true -%}
|
| 284 |
+
{%- else -%}
|
| 285 |
+
{%- set follow = loop_messages[k] -%}
|
| 286 |
+
{#- Resolve tool_call_id to function name -#}
|
| 287 |
+
{%- set ns_tname = namespace(name=follow.get('name') or 'unknown') -%}
|
| 288 |
+
{%- for tc in message.get('tool_calls') -%}
|
| 289 |
+
{%- if tc.get('id') == follow.get('tool_call_id') -%}
|
| 290 |
+
{%- set ns_tname.name = tc['function']['name'] -%}
|
| 291 |
+
{%- endif -%}
|
| 292 |
+
{%- endfor -%}
|
| 293 |
+
{#- Handle content as string or content-parts array -#}
|
| 294 |
+
{%- set tool_body = follow.get('content') -%}
|
| 295 |
+
{%- if tool_body is string -%}
|
| 296 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 297 |
+
{%- elif tool_body is sequence and tool_body is not string -%}
|
| 298 |
+
{%- set ns_txt = namespace(s='') -%}
|
| 299 |
+
{%- for part in tool_body -%}
|
| 300 |
+
{%- if part.get('type') == 'text' -%}
|
| 301 |
+
{%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
|
| 302 |
+
{%- endif -%}
|
| 303 |
+
{%- endfor -%}
|
| 304 |
+
{{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
|
| 305 |
+
{%- for part in tool_body -%}
|
| 306 |
+
{%- if part.get('type') in ['image', 'image_url'] -%}
|
| 307 |
+
{{- '<|image|>' -}}
|
| 308 |
+
{%- elif part.get('type') in ['audio', 'input_audio'] -%}
|
| 309 |
+
{{- '<|audio|>' -}}
|
| 310 |
+
{%- elif part.get('type') == 'video' -%}
|
| 311 |
+
{{- '<|video|>' -}}
|
| 312 |
+
{%- endif -%}
|
| 313 |
+
{%- endfor -%}
|
| 314 |
+
{%- else -%}
|
| 315 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 316 |
+
{%- endif -%}
|
| 317 |
+
{%- set ns_tr_out.flag = true -%}
|
| 318 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 319 |
+
{%- endif -%}
|
| 320 |
+
{%- endfor -%}
|
| 321 |
+
{%- endif -%}
|
| 322 |
+
|
| 323 |
+
{%- set captured_content -%}
|
| 324 |
+
{%- if message.get('content') is string -%}
|
| 325 |
+
{%- if role == 'model' -%}
|
| 326 |
+
{{- strip_thinking(message['content']) -}}
|
| 327 |
+
{%- else -%}
|
| 328 |
+
{{- message['content'] | trim -}}
|
| 329 |
+
{%- endif -%}
|
| 330 |
+
{%- elif message.get('content') is sequence -%}
|
| 331 |
+
{%- for item in message['content'] -%}
|
| 332 |
+
{%- if item.get('type') == 'text' -%}
|
| 333 |
+
{%- if role == 'model' -%}
|
| 334 |
+
{{- strip_thinking(item['text']) -}}
|
| 335 |
+
{%- else -%}
|
| 336 |
+
{{- item['text'] | trim -}}
|
| 337 |
+
{%- endif -%}
|
| 338 |
+
{%- elif item.get('type') in ['image', 'image_url'] -%}
|
| 339 |
+
{{- '<|image|>' -}}
|
| 340 |
+
{%- elif item.get('type') in ['audio', 'input_audio'] -%}
|
| 341 |
+
{{- '<|audio|>' -}}
|
| 342 |
+
{%- elif item.get('type') == 'video' -%}
|
| 343 |
+
{{- '<|video|>' -}}
|
| 344 |
+
{%- endif -%}
|
| 345 |
+
{%- endfor -%}
|
| 346 |
+
{%- endif -%}
|
| 347 |
+
{%- endset -%}
|
| 348 |
+
|
| 349 |
+
{{- captured_content -}}
|
| 350 |
+
{%- set has_content = captured_content | trim | length > 0 -%}
|
| 351 |
+
|
| 352 |
+
{#- Forward-scan: find next non-tool message role for continuation detection -#}
|
| 353 |
+
{%- set next_nt = namespace(role=None, found=false) -%}
|
| 354 |
+
{%- for j in range(loop.index0 + 1, loop_messages | length) -%}
|
| 355 |
+
{%- if not next_nt.found -%}
|
| 356 |
+
{%- if loop_messages[j]['role'] != 'tool' -%}
|
| 357 |
+
{%- set next_nt.role = loop_messages[j]['role'] -%}
|
| 358 |
+
{%- set next_nt.found = true -%}
|
| 359 |
+
{%- endif -%}
|
| 360 |
+
{%- endif -%}
|
| 361 |
+
{%- endfor -%}
|
| 362 |
+
|
| 363 |
+
{%- set continues_into_next = (
|
| 364 |
+
role == 'model'
|
| 365 |
+
and next_nt.role == 'assistant'
|
| 366 |
+
and (not message.get('tool_calls') or ns_tr_out.flag)
|
| 367 |
+
) -%}
|
| 368 |
+
|
| 369 |
+
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 370 |
+
{{- '<|tool_response>' -}}
|
| 371 |
+
{%- elif continues_into_next -%}
|
| 372 |
+
{%- elif not (ns_tr_out.flag and not has_content and not next_nt.found) -%}
|
| 373 |
+
{{- '<turn|>\n' -}}
|
| 374 |
+
{%- endif -%}
|
| 375 |
+
{%- endif -%}
|
| 376 |
+
|
| 377 |
+
{#- Track previous non-tool role for next iteration (avoids O(n) backward scan) -#}
|
| 378 |
+
{%- set ns.prev_non_tool_role = message['role'] -%}
|
| 379 |
+
{%- endfor -%}
|
| 380 |
+
|
| 381 |
+
{%- if add_generation_prompt -%}
|
| 382 |
+
{%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
|
| 383 |
+
{{- '<|turn>model\n' -}}
|
| 384 |
+
{%- elif ns.prev_message_type == 'tool_response' and enable_thinking -%}
|
| 385 |
+
{{- '<|channel>thought\n' -}}
|
| 386 |
+
{%- endif -%}
|
| 387 |
+
{%- endif -%}
|
generation_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"denoise_temperature": 0.8,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
1,
|
| 5 |
+
106
|
| 6 |
+
],
|
| 7 |
+
"max_denoising_steps": null,
|
| 8 |
+
"max_new_tokens": 256,
|
| 9 |
+
"one_token_per_denoise_step": false,
|
| 10 |
+
"repetition_penalty": 1.0,
|
| 11 |
+
"return_dict_in_generate": true,
|
| 12 |
+
"t_max": 0.8,
|
| 13 |
+
"t_min": 0.8,
|
| 14 |
+
"transformers_version": "5.14.1",
|
| 15 |
+
"turn_end_token_id": 106
|
| 16 |
+
}
|
model-00001-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:990b322d47df486108e725ff6884842b4b6512e98e57202d04be8b57ecd2b456
|
| 3 |
+
size 5363460572
|
model-00002-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2b7137b04fad66c8654441a9535b257862ee9f97ddf9d4b635ac3fe09b6366d
|
| 3 |
+
size 4884577974
|
model-00003-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c58d6983f7796596da51974362aefc6f578aea6c572eb1ff404c76d10ae6d69
|
| 3 |
+
size 4913414718
|
model-00004-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:89ff79354e9cbb2912756be80fd9dfc487fdb226f25e78248397080c89f3d830
|
| 3 |
+
size 4884577998
|
model-00005-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41a2615fab0008f86cd27ea11d04edda0cea8f8e92b3f579ee2f21c4fc642357
|
| 3 |
+
size 4913414782
|
model-00006-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8059cb7856f4bc999bfbba2ef805bbfca7caa4857f07388f75369064cfa01209
|
| 3 |
+
size 4884578038
|
model-00007-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4e5e17d862209d68ef619895f1ac31b1dded2a3c151738e8241d9c85d147c764
|
| 3 |
+
size 4913414782
|
model-00008-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7f553a5906c249c4c2181fed3fa6b59ea6b8e8bfe6a0844b5a375c7e81957edd
|
| 3 |
+
size 4884578038
|
model-00009-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46bdb5a161862beeebe862d5dba46562b8d0c511c84aac87355433b45a30ae4c
|
| 3 |
+
size 4913414782
|
model-00010-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b1d6491992dfe7b4ccf4ee266594bc754c90dace3c8c7fb21e5c149e64b57841
|
| 3 |
+
size 4884578038
|
model-00011-of-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b60ca12117cdb0165501adf18ecb7fef85310db6565cf6004bc72aebfe726573
|
| 3 |
+
size 2838371094
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
processor_config.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_ms_per_token": 40,
|
| 3 |
+
"audio_seq_length": 750,
|
| 4 |
+
"feature_extractor": {
|
| 5 |
+
"dither": 0.0,
|
| 6 |
+
"feature_extractor_type": "Gemma4AudioFeatureExtractor",
|
| 7 |
+
"feature_size": 128,
|
| 8 |
+
"fft_length": 512,
|
| 9 |
+
"fft_overdrive": false,
|
| 10 |
+
"frame_length": 320,
|
| 11 |
+
"hop_length": 160,
|
| 12 |
+
"input_scale_factor": 1.0,
|
| 13 |
+
"max_frequency": 8000.0,
|
| 14 |
+
"mel_floor": 0.001,
|
| 15 |
+
"min_frequency": 0.0,
|
| 16 |
+
"padding_side": "right",
|
| 17 |
+
"padding_value": 0.0,
|
| 18 |
+
"per_bin_mean": null,
|
| 19 |
+
"per_bin_stddev": null,
|
| 20 |
+
"preemphasis": 0.0,
|
| 21 |
+
"preemphasis_htk_flavor": true,
|
| 22 |
+
"return_attention_mask": true,
|
| 23 |
+
"sampling_rate": 16000
|
| 24 |
+
},
|
| 25 |
+
"image_processor": {
|
| 26 |
+
"do_convert_rgb": true,
|
| 27 |
+
"do_normalize": false,
|
| 28 |
+
"do_rescale": true,
|
| 29 |
+
"do_resize": true,
|
| 30 |
+
"image_mean": [
|
| 31 |
+
0.0,
|
| 32 |
+
0.0,
|
| 33 |
+
0.0
|
| 34 |
+
],
|
| 35 |
+
"image_processor_type": "Gemma4ImageProcessor",
|
| 36 |
+
"image_seq_length": 280,
|
| 37 |
+
"image_std": [
|
| 38 |
+
1.0,
|
| 39 |
+
1.0,
|
| 40 |
+
1.0
|
| 41 |
+
],
|
| 42 |
+
"max_soft_tokens": 280,
|
| 43 |
+
"patch_size": 16,
|
| 44 |
+
"pooling_kernel_size": 3,
|
| 45 |
+
"resample": 3,
|
| 46 |
+
"rescale_factor": 0.00392156862745098
|
| 47 |
+
},
|
| 48 |
+
"image_seq_length": 280,
|
| 49 |
+
"processor_class": "Gemma4Processor",
|
| 50 |
+
"video_processor": {
|
| 51 |
+
"do_convert_rgb": true,
|
| 52 |
+
"do_normalize": true,
|
| 53 |
+
"do_rescale": true,
|
| 54 |
+
"do_resize": true,
|
| 55 |
+
"do_sample_frames": true,
|
| 56 |
+
"image_mean": [
|
| 57 |
+
0.0,
|
| 58 |
+
0.0,
|
| 59 |
+
0.0
|
| 60 |
+
],
|
| 61 |
+
"image_std": [
|
| 62 |
+
1.0,
|
| 63 |
+
1.0,
|
| 64 |
+
1.0
|
| 65 |
+
],
|
| 66 |
+
"max_soft_tokens": 70,
|
| 67 |
+
"num_frames": 32,
|
| 68 |
+
"patch_size": 16,
|
| 69 |
+
"pooling_kernel_size": 3,
|
| 70 |
+
"resample": 3,
|
| 71 |
+
"rescale_factor": 0.00392156862745098,
|
| 72 |
+
"return_metadata": false,
|
| 73 |
+
"video_processor_type": "Gemma4VideoProcessor"
|
| 74 |
+
}
|
| 75 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f
|
| 3 |
+
size 32169626
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_token": "<|audio|>",
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"boa_token": "<|audio>",
|
| 5 |
+
"boi_token": "<|image>",
|
| 6 |
+
"bos_token": "<bos>",
|
| 7 |
+
"eoa_token": "<audio|>",
|
| 8 |
+
"eoc_token": "<channel|>",
|
| 9 |
+
"eoi_token": "<image|>",
|
| 10 |
+
"eos_token": "<eos>",
|
| 11 |
+
"eot_token": "<turn|>",
|
| 12 |
+
"escape_token": "<|\"|>",
|
| 13 |
+
"etc_token": "<tool_call|>",
|
| 14 |
+
"etd_token": "<tool|>",
|
| 15 |
+
"etr_token": "<tool_response|>",
|
| 16 |
+
"extra_special_tokens": [
|
| 17 |
+
"<|video|>"
|
| 18 |
+
],
|
| 19 |
+
"image_token": "<|image|>",
|
| 20 |
+
"is_local": true,
|
| 21 |
+
"local_files_only": false,
|
| 22 |
+
"mask_token": "<mask>",
|
| 23 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 24 |
+
"model_specific_special_tokens": {
|
| 25 |
+
"audio_token": "<|audio|>",
|
| 26 |
+
"boa_token": "<|audio>",
|
| 27 |
+
"boi_token": "<|image>",
|
| 28 |
+
"eoa_token": "<audio|>",
|
| 29 |
+
"eoc_token": "<channel|>",
|
| 30 |
+
"eoi_token": "<image|>",
|
| 31 |
+
"eot_token": "<turn|>",
|
| 32 |
+
"escape_token": "<|\"|>",
|
| 33 |
+
"etc_token": "<tool_call|>",
|
| 34 |
+
"etd_token": "<tool|>",
|
| 35 |
+
"etr_token": "<tool_response|>",
|
| 36 |
+
"image_token": "<|image|>",
|
| 37 |
+
"soc_token": "<|channel>",
|
| 38 |
+
"sot_token": "<|turn>",
|
| 39 |
+
"stc_token": "<|tool_call>",
|
| 40 |
+
"std_token": "<|tool>",
|
| 41 |
+
"str_token": "<|tool_response>",
|
| 42 |
+
"think_token": "<|think|>"
|
| 43 |
+
},
|
| 44 |
+
"pad_token": "<pad>",
|
| 45 |
+
"padding_side": "left",
|
| 46 |
+
"processor_class": "Gemma4Processor",
|
| 47 |
+
"response_schema": {
|
| 48 |
+
"properties": {
|
| 49 |
+
"content": {
|
| 50 |
+
"type": "string"
|
| 51 |
+
},
|
| 52 |
+
"role": {
|
| 53 |
+
"const": "assistant"
|
| 54 |
+
},
|
| 55 |
+
"thinking": {
|
| 56 |
+
"type": "string"
|
| 57 |
+
},
|
| 58 |
+
"tool_calls": {
|
| 59 |
+
"items": {
|
| 60 |
+
"properties": {
|
| 61 |
+
"function": {
|
| 62 |
+
"properties": {
|
| 63 |
+
"arguments": {
|
| 64 |
+
"additionalProperties": {},
|
| 65 |
+
"type": "object",
|
| 66 |
+
"x-parser": "gemma4-tool-call"
|
| 67 |
+
},
|
| 68 |
+
"name": {
|
| 69 |
+
"type": "string"
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
"type": "object",
|
| 73 |
+
"x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
|
| 74 |
+
},
|
| 75 |
+
"type": {
|
| 76 |
+
"const": "function"
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"type": "object"
|
| 80 |
+
},
|
| 81 |
+
"type": "array",
|
| 82 |
+
"x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
|
| 83 |
+
}
|
| 84 |
+
},
|
| 85 |
+
"type": "object",
|
| 86 |
+
"x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
|
| 87 |
+
},
|
| 88 |
+
"soc_token": "<|channel>",
|
| 89 |
+
"sot_token": "<|turn>",
|
| 90 |
+
"stc_token": "<|tool_call>",
|
| 91 |
+
"std_token": "<|tool>",
|
| 92 |
+
"str_token": "<|tool_response>",
|
| 93 |
+
"think_token": "<|think|>",
|
| 94 |
+
"tokenizer_class": "GemmaTokenizer",
|
| 95 |
+
"unk_token": "<unk>"
|
| 96 |
+
}
|