Text Generation
Transformers
Safetensors
Russian
English
zarya
feature-extraction
dllm
diffusion
diffusion-language-modeling
instruct
conversational
custom_code
Instructions to use ai-forever/Zarya-0.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ai-forever/Zarya-0.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ai-forever/Zarya-0.6B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ai-forever/Zarya-0.6B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ai-forever/Zarya-0.6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ai-forever/Zarya-0.6B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-forever/Zarya-0.6B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ai-forever/Zarya-0.6B
- SGLang
How to use ai-forever/Zarya-0.6B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ai-forever/Zarya-0.6B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-forever/Zarya-0.6B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ai-forever/Zarya-0.6B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-forever/Zarya-0.6B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ai-forever/Zarya-0.6B with Docker Model Runner:
docker model run hf.co/ai-forever/Zarya-0.6B
Zarya-0.6B model initial upload
Browse files- .gitattributes +1 -0
- README.md +423 -0
- chat_template.jinja +89 -0
- config.json +91 -0
- configuration.py +131 -0
- generation_config.json +21 -0
- generation_utils.py +28 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- modeling.py +0 -0
- tokenizer.json +3 -0
- tokenizer_config.json +251 -0
- vocab.json +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,423 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- ru
|
| 5 |
+
- en
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- dllm
|
| 9 |
+
- diffusion
|
| 10 |
+
- diffusion-language-modeling
|
| 11 |
+
- instruct
|
| 12 |
+
library_name: transformers
|
| 13 |
+
---
|
| 14 |
+
# Zarya-0.6B
|
| 15 |
+
|
| 16 |
+
Zarya is a family of hybrid language models that combine a classic auto-regressive (AR) objective with a masked-diffusion (MDM) objective in one model.
|
| 17 |
+
The architecture can be built on top of any autoregressive model but in this repository it uses the `Qwen3` backbone.
|
| 18 |
+
|
| 19 |
+
Naming explanation: Zarya (pronounced as [zɐˈrʲa] ([IPA notation](https://en.wiktionary.org/wiki/Appendix:Russian_pronunciation)), literally "Dawn" in English) is a figure from Slavic folklore — a female personification of dawn who may be considered a goddess.
|
| 20 |
+
In various traditions, she can manifest as a single being or as two or three sisters simultaneously.
|
| 21 |
+
|
| 22 |
+
This is a research prototype.
|
| 23 |
+
|
| 24 |
+
## Model Details
|
| 25 |
+
|
| 26 |
+
### Model Description
|
| 27 |
+
|
| 28 |
+
Zarya is a research prototype of a family of hybrid language models that jointly learn a classic auto-regressive (AR) objective and a masked-diffusion (MDM) objective within a single model.
|
| 29 |
+
|
| 30 |
+
Two generation modes are supported, both reachable through a single `model.generate(...)` call: masked-diffusion (MDM) sampling and slotted-level speculative parallel decoding.
|
| 31 |
+
|
| 32 |
+
- **Model type:** Hybrid auto-regressive (AR) + masked-diffusion language model (DLLM); backbone `Qwen3`, wrapper `Zarya`
|
| 33 |
+
- **Language(s) (NLP):** Russian and English
|
| 34 |
+
- **License:** MIT
|
| 35 |
+
- **Preprint:** https://arxiv.org/abs/2609.19868
|
| 36 |
+
- **Repository with training code:** https://github.com/ai-forever/zarya
|
| 37 |
+
|
| 38 |
+
### Zarya-0.6B details
|
| 39 |
+
Zarya-0.6B has the following features:
|
| 40 |
+
|
| 41 |
+
| Variant | hidden_size | num_hidden_layers | num_attention_heads | intermediate_size |
|
| 42 |
+
|------------|-------------|-------------------|---------------------|-------------------|
|
| 43 |
+
| Zarya-0.6B | 1024 | 28 | 16 | 3072 |
|
| 44 |
+
|
| 45 |
+
Context Length: 2048
|
| 46 |
+
|
| 47 |
+
## Uses
|
| 48 |
+
|
| 49 |
+
Zarya is intended for text generation.
|
| 50 |
+
It supports conversational fine-tuning (SFT) and classic auto-regressive pretraining.
|
| 51 |
+
|
| 52 |
+
### Direct Use
|
| 53 |
+
|
| 54 |
+
Direct use is text generation (continuation of a prompt) through the `model.generate(...)` interface, including chat-style prompts formatted with the provided chat template.
|
| 55 |
+
Two inference modes are available through the same `generate()` call.
|
| 56 |
+
Both modes fully use the KV cache with causal attention masks.
|
| 57 |
+
- **MDM sampling** (`slotted_generation=false`): iterative masked-diffusion denoising with the first-hitting sampler.
|
| 58 |
+
- **Slotted speculative decoding** (`slotted_generation=true`): parallel slot generation with inter-slot diffusion-based selection and intra-slot autoregressive generation for a decoding speedup.
|
| 59 |
+
|
| 60 |
+
### Out-of-Scope Use
|
| 61 |
+
|
| 62 |
+
The model is a research prototype.
|
| 63 |
+
It should not be used for production decisions, safety-critical applications, or any use case where accuracy and reliability are essential without additional evaluation and safeguards.
|
| 64 |
+
Inference performance and stability also depend on the chosen decoding hyperparameters (like `slotted_generation`, `slot_size`, `serial_num_blocks`, `slot_threshold`, `token_threshold`, and others).
|
| 65 |
+
|
| 66 |
+
## Bias, Risks, and Limitations
|
| 67 |
+
|
| 68 |
+
This is a research prototype.
|
| 69 |
+
The code relies on Hugging Face Transformers APIs; when upgrading versions, compatibility must be checked (tested on Transformers 5.12.1 and PyTorch 2.9.0).
|
| 70 |
+
Inference performance and stability depend on the choice of config parameters.
|
| 71 |
+
|
| 72 |
+
## How to Get Started with the Model
|
| 73 |
+
|
| 74 |
+
Use the code below to get started with the model. Loading the model and tokenizer requires `trust_remote_code=True`.
|
| 75 |
+
|
| 76 |
+
```python
|
| 77 |
+
import torch
|
| 78 |
+
from transformers import AutoModel, AutoTokenizer
|
| 79 |
+
|
| 80 |
+
model_name = "ai-forever/Zarya-0.6B"
|
| 81 |
+
|
| 82 |
+
model = AutoModel.from_pretrained(model_name, trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
|
| 83 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 84 |
+
|
| 85 |
+
prompt = "<|im_start|>user\nHello!<|im_end|>\n<|im_start|>assistant\n"
|
| 86 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.cuda()
|
| 87 |
+
|
| 88 |
+
# Both modes go through model.generate(...).
|
| 89 |
+
# With generation_config.slotted_generation=true -> slotted speculative decoding:
|
| 90 |
+
out = model.generate(
|
| 91 |
+
input_ids,
|
| 92 |
+
max_new_tokens=256,
|
| 93 |
+
do_sample=True,
|
| 94 |
+
temperature=0.7,
|
| 95 |
+
slot_size=16,
|
| 96 |
+
serial_num_blocks=4,
|
| 97 |
+
slot_threshold=0.9,
|
| 98 |
+
token_threshold=0.3,
|
| 99 |
+
)
|
| 100 |
+
# Setting generation_config.slotted_generation=false -> MDM sampling instead:
|
| 101 |
+
# out = model.generate(input_ids, max_new_tokens=256)
|
| 102 |
+
|
| 103 |
+
print(tokenizer.decode(out[0]))
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
## Evaluation
|
| 108 |
+
|
| 109 |
+
LM-eval benchmarking with the `lm-eval` package is supported. Example run:
|
| 110 |
+
|
| 111 |
+
```bash
|
| 112 |
+
lm_eval run \
|
| 113 |
+
--tasks=gsm8k,ifeval,arc_challenge,hendrycks_math500,humaneval_instruct,humaneval,mbpp,mbpp_plus,hellaswag \
|
| 114 |
+
--model=hf --confirm_run_unsafe_code \
|
| 115 |
+
--log_samples \
|
| 116 |
+
--apply_chat_template \
|
| 117 |
+
--output_path=./reports/lm-eval_results \
|
| 118 |
+
--model_args=pretrained=ai-forever/Zarya-0.6B,backend=causal,dtype=bfloat16,attn_implementation=sdpa,trust_remote_code=True \
|
| 119 |
+
--gen_kwargs slotted_generation=true,slot_size=16,serial_num_blocks=4,slot_threshold=0.9,token_threshold=0.4
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
### Zarya-0.6B results
|
| 123 |
+
|
| 124 |
+
Measurements below were collected with varying inference parameters and on different GPUs; performance is sensitive to both, so results may differ across configurations and hardware setups.
|
| 125 |
+
|
| 126 |
+
#### A100, `dtype=bfloat16`, `apply_chat_template`, `slotted_generation=true,slot_size=16,serial_num_blocks=4,slot_threshold=0.9,token_threshold=0.4`
|
| 127 |
+
|
| 128 |
+
Hardware info:
|
| 129 |
+
gpu_driver_cuda_version 13.2;
|
| 130 |
+
gpu_driver_version 595.71.05;
|
| 131 |
+
|
| 132 |
+
Docker info:
|
| 133 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 134 |
+
`lm-eval == 0.4.12`
|
| 135 |
+
|
| 136 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 137 |
+
|-----------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 138 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.2646 | ± | 0.0122 |
|
| 139 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.2646 | ± | 0.0122 |
|
| 140 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3526 | ± | 0.0048 |
|
| 141 |
+
| | | none | 0 | acc_norm | ↑ | 0.4270 | ± | 0.0049 |
|
| 142 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.5372 | ± | N/A |
|
| 143 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.5108 | ± | N/A |
|
| 144 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.4177 | ± | 0.0212 |
|
| 145 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.3993 | ± | 0.0211 |
|
| 146 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.1500 | ± | 0.0160 |
|
| 147 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.2249 | ± | 0.0215 |
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
#### H100, `dtype=bfloat16`, `apply_chat_template`, `slotted_generation=true,slot_size=16,serial_num_blocks=4,slot_threshold=0.9,token_threshold=0.4`
|
| 151 |
+
|
| 152 |
+
Hardware info:
|
| 153 |
+
gpu_driver_cuda_version 13.0;
|
| 154 |
+
gpu_driver_version 580.105.08;
|
| 155 |
+
|
| 156 |
+
Docker info:
|
| 157 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 158 |
+
`lm-eval == 0.4.12`
|
| 159 |
+
|
| 160 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 161 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 162 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.3063 | ± | 0.0135 |
|
| 163 |
+
| | | none | 0 | acc_norm | ↑ | 0.3464 | ± | 0.0139 |
|
| 164 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0379 | ± | 0.0053 |
|
| 165 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0243 | ± | 0.0042 |
|
| 166 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3525 | ± | 0.0048 |
|
| 167 |
+
| | | none | 0 | acc_norm | ↑ | 0.4266 | ± | 0.0049 |
|
| 168 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0280 | ± | 0.0074 |
|
| 169 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 170 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0671 | ± | 0.0196 |
|
| 171 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.4365 | ± | N/A |
|
| 172 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.4161 | ± | N/A |
|
| 173 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.2884 | ± | 0.0195 |
|
| 174 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.2662 | ± | 0.0190 |
|
| 175 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 176 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 177 |
+
|
| 178 |
+
#### H100, `dtype=bfloat16`, `apply_chat_template`, `slotted_generation=false,T=0,temperature=0.5,top_p=0.8,do_sample=true,noise_schedule=linear`
|
| 179 |
+
|
| 180 |
+
Hardware info:
|
| 181 |
+
gpu_driver_cuda_version 13.0;
|
| 182 |
+
gpu_driver_version 580.105.08;
|
| 183 |
+
|
| 184 |
+
Docker info:
|
| 185 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 186 |
+
`lm-eval == 0.4.12`
|
| 187 |
+
|
| 188 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 189 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 190 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.3063 | ± | 0.0135 |
|
| 191 |
+
| | | none | 0 | acc_norm | ↑ | 0.3464 | ± | 0.0139 |
|
| 192 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0091 | ± | 0.0026 |
|
| 193 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0000 | ± | 0 |
|
| 194 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3525 | ± | 0.0048 |
|
| 195 |
+
| | | none | 0 | acc_norm | ↑ | 0.4266 | ± | 0.0049 |
|
| 196 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0000 | ± | 0 |
|
| 197 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 198 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 199 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.2230 | ± | N/A |
|
| 200 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.1906 | ± | N/A |
|
| 201 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.1257 | ± | 0.0143 |
|
| 202 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.1035 | ± | 0.0131 |
|
| 203 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 204 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
#### H100, `dtype=bfloat16`, `slotted_generation=false,T=0,temperature=0.5,top_p=0.8,do_sample=true,noise_schedule=linear`
|
| 208 |
+
|
| 209 |
+
Hardware info:
|
| 210 |
+
gpu_driver_cuda_version 13.0;
|
| 211 |
+
gpu_driver_version 580.126.20;
|
| 212 |
+
|
| 213 |
+
Docker info:
|
| 214 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 215 |
+
`lm-eval == 0.4.12`
|
| 216 |
+
|
| 217 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 218 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 219 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.2850 | ± | 0.0132 |
|
| 220 |
+
| | | none | 0 | acc_norm | ↑ | 0.3046 | ± | 0.0134 |
|
| 221 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0114 | ± | 0.0029 |
|
| 222 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0015 | ± | 0.0011 |
|
| 223 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3295 | ± | 0.0047 |
|
| 224 |
+
| | | none | 0 | acc_norm | ↑ | 0.4018 | ± | 0.0049 |
|
| 225 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0000 | ± | 0 |
|
| 226 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 227 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 228 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.1942 | ± | N/A |
|
| 229 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.1894 | ± | N/A |
|
| 230 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.0980 | ± | 0.0128 |
|
| 231 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.0943 | ± | 0.0126 |
|
| 232 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 233 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 234 |
+
|
| 235 |
+
#### H100, `dtype=bfloat16`, `slotted_generation=true,slot_size=16,serial_num_blocks=4,slot_threshold=0.9,token_threshold=0.4`
|
| 236 |
+
|
| 237 |
+
Hardware info:
|
| 238 |
+
gpu_driver_cuda_version 13.0;
|
| 239 |
+
gpu_driver_version 580.105.08;
|
| 240 |
+
|
| 241 |
+
Docker info:
|
| 242 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 243 |
+
`lm-eval == 0.4.12`
|
| 244 |
+
|
| 245 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 246 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 247 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.2850 | ± | 0.0132 |
|
| 248 |
+
| | | none | 0 | acc_norm | ↑ | 0.3046 | ± | 0.0134 |
|
| 249 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0129 | ± | 0.0031 |
|
| 250 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0250 | ± | 0.0043 |
|
| 251 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3295 | ± | 0.0047 |
|
| 252 |
+
| | | none | 0 | acc_norm | ↑ | 0.4018 | ± | 0.0049 |
|
| 253 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0000 | ± | 0 |
|
| 254 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0305 | ± | 0.0135 |
|
| 255 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0122 | ± | 0.0086 |
|
| 256 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.3921 | ± | N/A |
|
| 257 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.3489 | ± | N/A |
|
| 258 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.2625 | ± | 0.0189 |
|
| 259 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.2274 | ± | 0.0180 |
|
| 260 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 261 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 262 |
+
|
| 263 |
+
#### H100, `dtype=float32`, `apply_chat_template`, `slotted_generation=true,slot_size=16,serial_num_blocks=4,slot_threshold=0.9,token_threshold=0.4`
|
| 264 |
+
|
| 265 |
+
Hardware info:
|
| 266 |
+
gpu_driver_cuda_version 13.0;
|
| 267 |
+
gpu_driver_version 580.126.20;
|
| 268 |
+
|
| 269 |
+
Docker info:
|
| 270 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 271 |
+
`lm-eval == 0.4.12`
|
| 272 |
+
|
| 273 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 274 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 275 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.3055 | ± | 0.0135 |
|
| 276 |
+
| | | none | 0 | acc_norm | ↑ | 0.3456 | ± | 0.0139 |
|
| 277 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0250 | ± | 0.0043 |
|
| 278 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0136 | ± | 0.0032 |
|
| 279 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3525 | ± | 0.0048 |
|
| 280 |
+
| | | none | 0 | acc_norm | ↑ | 0.4281 | ± | 0.0049 |
|
| 281 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0200 | ± | 0.0063 |
|
| 282 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 283 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0671 | ± | 0.0196 |
|
| 284 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.3993 | ± | N/A |
|
| 285 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.3849 | ± | N/A |
|
| 286 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.2754 | ± | 0.0192 |
|
| 287 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.2643 | ± | 0.0190 |
|
| 288 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 289 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 290 |
+
|
| 291 |
+
|
| 292 |
+
#### H100, `dtype=float32`, `apply_chat_template`, `slotted_generation=false,T=0,temperature=0.5,top_p=0.8,do_sample=true,noise_schedule=linear`
|
| 293 |
+
|
| 294 |
+
Hardware info:
|
| 295 |
+
gpu_driver_cuda_version 13.0;
|
| 296 |
+
gpu_driver_version 580.126.20;
|
| 297 |
+
|
| 298 |
+
Docker info:
|
| 299 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 300 |
+
`lm-eval == 0.4.12`
|
| 301 |
+
|
| 302 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 303 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 304 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.3055 | ± | 0.0135 |
|
| 305 |
+
| | | none | 0 | acc_norm | ↑ | 0.3456 | ± | 0.0139 |
|
| 306 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0121 | ± | 0.0030 |
|
| 307 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0008 | ± | 0.0008 |
|
| 308 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3525 | ± | 0.0048 |
|
| 309 |
+
| | | none | 0 | acc_norm | ↑ | 0.4281 | ± | 0.0049 |
|
| 310 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0000 | ± | 0 |
|
| 311 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 312 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 313 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.2362 | ± | N/A |
|
| 314 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.1966 | ± | N/A |
|
| 315 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.1423 | ± | 0.0150 |
|
| 316 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.1091 | ± | 0.0134 |
|
| 317 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 318 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 319 |
+
|
| 320 |
+
|
| 321 |
+
#### H100, `dtype=float16`, `apply_chat_template`, `slotted_generation=true,slot_size=16,serial_num_blocks=4,slot_threshold=0.9,token_threshold=0.4`
|
| 322 |
+
|
| 323 |
+
Hardware info:
|
| 324 |
+
gpu_driver_cuda_version 13.0;
|
| 325 |
+
gpu_driver_version 580.126.20;
|
| 326 |
+
|
| 327 |
+
Docker info:
|
| 328 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 329 |
+
`lm-eval == 0.4.12`
|
| 330 |
+
|
| 331 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 332 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 333 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.3055 | ± | 0.0135 |
|
| 334 |
+
| | | none | 0 | acc_norm | ↑ | 0.3447 | ± | 0.0139 |
|
| 335 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0235 | ± | 0.0042 |
|
| 336 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0159 | ± | 0.0034 |
|
| 337 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3525 | ± | 0.0048 |
|
| 338 |
+
| | | none | 0 | acc_norm | ↑ | 0.4277 | ± | 0.0049 |
|
| 339 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0180 | ± | 0.0060 |
|
| 340 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 341 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0732 | ± | 0.0204 |
|
| 342 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.4077 | ± | N/A |
|
| 343 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.3981 | ± | N/A |
|
| 344 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.2754 | ± | 0.0192 |
|
| 345 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.2606 | ± | 0.0189 |
|
| 346 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 347 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 348 |
+
|
| 349 |
+
|
| 350 |
+
#### H100, `dtype=float16`, `apply_chat_template`, `slotted_generation=false,T=0,temperature=0.5,top_p=0.8,do_sample=true,noise_schedule=linear`
|
| 351 |
+
|
| 352 |
+
Hardware info:
|
| 353 |
+
gpu_driver_cuda_version 13.0;
|
| 354 |
+
gpu_driver_version 580.126.20;
|
| 355 |
+
|
| 356 |
+
Docker info:
|
| 357 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 358 |
+
`lm-eval == 0.4.12`
|
| 359 |
+
|
| 360 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 361 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 362 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.3055 | ± | 0.0135 |
|
| 363 |
+
| | | none | 0 | acc_norm | ↑ | 0.3447 | ± | 0.0139 |
|
| 364 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0114 | ± | 0.0029 |
|
| 365 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0000 | ± | 0 |
|
| 366 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3525 | ± | 0.0048 |
|
| 367 |
+
| | | none | 0 | acc_norm | ↑ | 0.4277 | ± | 0.0049 |
|
| 368 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0000 | ± | 0 |
|
| 369 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 370 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 371 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.2410 | ± | N/A |
|
| 372 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.2014 | ± | N/A |
|
| 373 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.1460 | ± | 0.0152 |
|
| 374 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.1128 | ± | 0.0136 |
|
| 375 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 376 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 377 |
+
|
| 378 |
+
|
| 379 |
+
#### H100, `dtype=bfloat16`, `apply_chat_template`, `slotted_generation=true,slot_size=16,serial_num_blocks=4,slot_threshold=0.9,token_threshold=0.4,max_gen_toks=2048`
|
| 380 |
+
|
| 381 |
+
Hardware info:
|
| 382 |
+
gpu_driver_cuda_version 13.0;
|
| 383 |
+
gpu_driver_version 580.105.08;
|
| 384 |
+
|
| 385 |
+
Docker info:
|
| 386 |
+
Torch: 2.9.0+cu128; Transformers: 5.12.1; CUDNN in torch: 91002;
|
| 387 |
+
`lm-eval == 0.4.12`
|
| 388 |
+
|
| 389 |
+
| Tasks | Version | Filter | n-shot | Metric | | Value | | Stderr |
|
| 390 |
+
|--------------------|--------:|------------------|-------:|-------------------------|---|-------:|---|--------|
|
| 391 |
+
| arc_challenge | 1 | none | 0 | acc | ↑ | 0.3063 | ± | 0.0135 |
|
| 392 |
+
| | | none | 0 | acc_norm | ↑ | 0.3464 | ± | 0.0139 |
|
| 393 |
+
| gsm8k | 3 | flexible-extract | 5 | exact_match | ↑ | 0.0182 | ± | 0.0037 |
|
| 394 |
+
| | | strict-match | 5 | exact_match | ↑ | 0.0023 | ± | 0.0013 |
|
| 395 |
+
| hellaswag | 1 | none | 0 | acc | ↑ | 0.3525 | ± | 0.0048 |
|
| 396 |
+
| | | none | 0 | acc_norm | ↑ | 0.4266 | ± | 0.0049 |
|
| 397 |
+
| hendrycks_math500 | 1 | none | 0 | exact_match | ↑ | 0.0240 | ± | 0.0069 |
|
| 398 |
+
| humaneval | 1 | create_test | 0 | pass@1 | ↑ | 0.0000 | ± | 0 |
|
| 399 |
+
| humaneval_instruct | 4 | create_test | 0 | pass@1 | ↑ | 0.0671 | ± | 0.0196 |
|
| 400 |
+
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.3933 | ± | N/A |
|
| 401 |
+
| | | none | 0 | inst_level_strict_acc | ↑ | 0.3789 | ± | N/A |
|
| 402 |
+
| | | none | 0 | prompt_level_loose_acc | ↑ | 0.2680 | ± | 0.0191 |
|
| 403 |
+
| | | none | 0 | prompt_level_strict_acc | ↑ | 0.2606 | ± | 0.0189 |
|
| 404 |
+
| mbpp | 1 | none | 3 | pass_at_1 | ↑ | 0.0020 | ± | 0.0020 |
|
| 405 |
+
| mbpp_plus | 1 | none | 3 | pass_at_1 | ↑ | 0.0000 | ± | 0 |
|
| 406 |
+
|
| 407 |
+
---
|
| 408 |
+
|
| 409 |
+
## Citation
|
| 410 |
+
|
| 411 |
+
If you find our work helpful, please consider citing (citation will be updated after peer-reviewed publication):
|
| 412 |
+
|
| 413 |
+
```bibtex
|
| 414 |
+
@misc{sinev-etal-2026-Zarya,
|
| 415 |
+
author = {Sinev, Leonid and Koziev, Ilya and Leshchuk, Vladislav},
|
| 416 |
+
title = {Zarya: A Hybrid Autoregressive--Masked Diffusion Language Model with Flexible Training and Dual-Mode Inference},
|
| 417 |
+
year = {2026},
|
| 418 |
+
archiveprefix = {arXiv},
|
| 419 |
+
eprint = {2609.19868},
|
| 420 |
+
primaryclass = {cs.CL},
|
| 421 |
+
url = {https://arxiv.org/abs/2609.19868},
|
| 422 |
+
}
|
| 423 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
| 5 |
+
{%- endif %}
|
| 6 |
+
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 7 |
+
{%- for tool in tools %}
|
| 8 |
+
{{- "\n" }}
|
| 9 |
+
{{- tool | tojson }}
|
| 10 |
+
{%- endfor %}
|
| 11 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 12 |
+
{%- else %}
|
| 13 |
+
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
+
{%- endif %}
|
| 16 |
+
{%- endif %}
|
| 17 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
+
{%- for message in messages[::-1] %}
|
| 19 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
+
{%- set ns.multi_step_tool = false %}
|
| 22 |
+
{%- set ns.last_query_index = index %}
|
| 23 |
+
{%- endif %}
|
| 24 |
+
{%- endfor %}
|
| 25 |
+
{%- for message in messages %}
|
| 26 |
+
{%- if message.content is string %}
|
| 27 |
+
{%- set content = message.content %}
|
| 28 |
+
{%- else %}
|
| 29 |
+
{%- set content = '' %}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
+
{%- elif message.role == "assistant" %}
|
| 34 |
+
{%- set reasoning_content = '' %}
|
| 35 |
+
{%- if message.reasoning_content is string %}
|
| 36 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
+
{%- else %}
|
| 38 |
+
{%- if '</think>' in content %}
|
| 39 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 40 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{%- endif %}
|
| 43 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 44 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 45 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 46 |
+
{%- else %}
|
| 47 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 48 |
+
{%- endif %}
|
| 49 |
+
{%- else %}
|
| 50 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 51 |
+
{%- endif %}
|
| 52 |
+
{%- if message.tool_calls %}
|
| 53 |
+
{%- for tool_call in message.tool_calls %}
|
| 54 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 55 |
+
{{- '\n' }}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if tool_call.function %}
|
| 58 |
+
{%- set tool_call = tool_call.function %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 61 |
+
{{- tool_call.name }}
|
| 62 |
+
{{- '", "arguments": ' }}
|
| 63 |
+
{%- if tool_call.arguments is string %}
|
| 64 |
+
{{- tool_call.arguments }}
|
| 65 |
+
{%- else %}
|
| 66 |
+
{{- tool_call.arguments | tojson }}
|
| 67 |
+
{%- endif %}
|
| 68 |
+
{{- '}\n</tool_call>' }}
|
| 69 |
+
{%- endfor %}
|
| 70 |
+
{%- endif %}
|
| 71 |
+
{{- '<|im_end|>\n' }}
|
| 72 |
+
{%- elif message.role == "tool" %}
|
| 73 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 74 |
+
{{- '<|im_start|>user' }}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{{- '\n<tool_response>\n' }}
|
| 77 |
+
{{- content }}
|
| 78 |
+
{{- '\n</tool_response>' }}
|
| 79 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 80 |
+
{{- '<|im_end|>\n' }}
|
| 81 |
+
{%- endif %}
|
| 82 |
+
{%- endif %}
|
| 83 |
+
{%- endfor %}
|
| 84 |
+
{%- if add_generation_prompt %}
|
| 85 |
+
{{- '<|im_start|>assistant\n' }}
|
| 86 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 87 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 88 |
+
{%- endif %}
|
| 89 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"T": 0,
|
| 3 |
+
"add_loss_path": false,
|
| 4 |
+
"alpha_0": 0.75,
|
| 5 |
+
"architectures": [
|
| 6 |
+
"Zarya"
|
| 7 |
+
],
|
| 8 |
+
"attention_bias": false,
|
| 9 |
+
"attention_dropout": 0.0,
|
| 10 |
+
"auto_map": {
|
| 11 |
+
"AutoConfig": "configuration.ZaryaConfig",
|
| 12 |
+
"AutoModel": "modeling.Zarya",
|
| 13 |
+
"AutoModelForCausalLM": "modeling.Zarya",
|
| 14 |
+
"AutoModelForMaskedLM": "modeling.Zarya"
|
| 15 |
+
},
|
| 16 |
+
"bos_token_id": 151644,
|
| 17 |
+
"diffusion_attn_mode": "causal",
|
| 18 |
+
"diffusion_loss_proportion": 0.5,
|
| 19 |
+
"diffusion_shuffle": true,
|
| 20 |
+
"dropout": 0.1,
|
| 21 |
+
"dtype": "bfloat16",
|
| 22 |
+
"eos_token_id": 151645,
|
| 23 |
+
"extra_processing": true,
|
| 24 |
+
"grouped_noise": false,
|
| 25 |
+
"head_dim": 128,
|
| 26 |
+
"hidden_act": "silu",
|
| 27 |
+
"hidden_size": 1024,
|
| 28 |
+
"initializer_range": 0.02,
|
| 29 |
+
"intermediate_size": 3072,
|
| 30 |
+
"layer_types": [
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"full_attention",
|
| 51 |
+
"full_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"full_attention",
|
| 54 |
+
"full_attention",
|
| 55 |
+
"full_attention",
|
| 56 |
+
"full_attention",
|
| 57 |
+
"full_attention",
|
| 58 |
+
"full_attention"
|
| 59 |
+
],
|
| 60 |
+
"mask_token_id": 151669,
|
| 61 |
+
"max_position_embeddings": 40960,
|
| 62 |
+
"max_window_layers": 28,
|
| 63 |
+
"model_type": "zarya",
|
| 64 |
+
"noise_eps": 0.001,
|
| 65 |
+
"noise_sorting": true,
|
| 66 |
+
"norm_elementwise_affine": true,
|
| 67 |
+
"norm_eps": 1e-06,
|
| 68 |
+
"num_attention_heads": 16,
|
| 69 |
+
"num_hidden_layers": 28,
|
| 70 |
+
"num_key_value_heads": 8,
|
| 71 |
+
"ordered_sampling": false,
|
| 72 |
+
"pad_token_id": 151643,
|
| 73 |
+
"rms_norm_eps": 1e-06,
|
| 74 |
+
"rope_scaling": null,
|
| 75 |
+
"rope_theta": 1000000,
|
| 76 |
+
"sample_t_override": 0.0,
|
| 77 |
+
"sample_t_upper": 0.1,
|
| 78 |
+
"sampling_eps": 0.001,
|
| 79 |
+
"scale_by_batch": false,
|
| 80 |
+
"sequential_attn_mode": "causal",
|
| 81 |
+
"sequential_shuffle": true,
|
| 82 |
+
"simple_masking": false,
|
| 83 |
+
"sliding_window": null,
|
| 84 |
+
"tie_word_embeddings": true,
|
| 85 |
+
"time_conditioning": false,
|
| 86 |
+
"transformers_version": "5.12.1",
|
| 87 |
+
"unnormalized_loss": false,
|
| 88 |
+
"use_cache": true,
|
| 89 |
+
"use_sliding_window": false,
|
| 90 |
+
"vocab_size": 151936
|
| 91 |
+
}
|
configuration.py
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Optional, Union
|
| 2 |
+
|
| 3 |
+
from transformers import AutoConfig, AutoModel # noqa: F401
|
| 4 |
+
from transformers.models.qwen3.configuration_qwen3 import Qwen3Config # noqa: F401
|
| 5 |
+
|
| 6 |
+
try:
|
| 7 |
+
from transformers import PreTrainedConfig # noqa: F401
|
| 8 |
+
except ImportError:
|
| 9 |
+
from transformers.configuration_utils import PretrainedConfig as PreTrainedConfig # noqa: F401
|
| 10 |
+
|
| 11 |
+
try:
|
| 12 |
+
from transformers.configuration_utils import layer_type_validation
|
| 13 |
+
except ImportError:
|
| 14 |
+
layer_type_validation = None
|
| 15 |
+
|
| 16 |
+
try:
|
| 17 |
+
from transformers.modeling_rope_utils import RopeParameters
|
| 18 |
+
except ImportError:
|
| 19 |
+
RopeParameters = None
|
| 20 |
+
|
| 21 |
+
try:
|
| 22 |
+
from transformers.modeling_rope_utils import rope_config_validation
|
| 23 |
+
except ImportError:
|
| 24 |
+
rope_config_validation = None
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
class ZaryaConfig(Qwen3Config):
|
| 28 |
+
"""Configuration class for Zarya model."""
|
| 29 |
+
|
| 30 |
+
model_type = "zarya"
|
| 31 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 32 |
+
|
| 33 |
+
# Default tensor parallel plan for base model
|
| 34 |
+
base_model_tp_plan = {
|
| 35 |
+
"layers.*.self_attn.q_proj": "colwise",
|
| 36 |
+
"layers.*.self_attn.k_proj": "colwise",
|
| 37 |
+
"layers.*.self_attn.v_proj": "colwise",
|
| 38 |
+
"layers.*.self_attn.q_norm": "replicated_with_grad_allreduce",
|
| 39 |
+
"layers.*.self_attn.k_norm": "replicated_with_grad_allreduce",
|
| 40 |
+
"layers.*.self_attn.o_proj": "rowwise",
|
| 41 |
+
"layers.*.mlp.gate_proj": "colwise",
|
| 42 |
+
"layers.*.mlp.up_proj": "colwise",
|
| 43 |
+
"layers.*.mlp.down_proj": "rowwise",
|
| 44 |
+
}
|
| 45 |
+
base_model_pp_plan = {
|
| 46 |
+
"embed_tokens": (["input_ids"], ["inputs_embeds"]),
|
| 47 |
+
"layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
|
| 48 |
+
"norm": (["hidden_states"], ["hidden_states"]),
|
| 49 |
+
}
|
| 50 |
+
backbone_class = "Qwen3ForCausalLM"
|
| 51 |
+
vocab_size: int = 151936
|
| 52 |
+
hidden_size: int = 1024
|
| 53 |
+
intermediate_size: int = 22016
|
| 54 |
+
num_hidden_layers: int = 12
|
| 55 |
+
num_attention_heads: int = 12
|
| 56 |
+
num_key_value_heads: Optional[int] = 12
|
| 57 |
+
head_dim: int = 128
|
| 58 |
+
hidden_act: str = "silu"
|
| 59 |
+
max_position_embeddings: int = 2048
|
| 60 |
+
initializer_range: float = 0.02
|
| 61 |
+
rms_norm_eps: float = 1e-6
|
| 62 |
+
use_cache: bool = True
|
| 63 |
+
tie_word_embeddings: bool = False
|
| 64 |
+
attention_bias: bool = False
|
| 65 |
+
use_sliding_window: bool = False
|
| 66 |
+
sliding_window: Optional[int] = None
|
| 67 |
+
max_window_layers: int = 28
|
| 68 |
+
layer_types: Optional[list[str]] = None
|
| 69 |
+
attention_dropout: Union[float, int] = 0.0
|
| 70 |
+
pad_token_id: Optional[int] = None
|
| 71 |
+
bos_token_id: Optional[int] = None
|
| 72 |
+
eos_token_id: Optional[Union[int, list[int]]] = None
|
| 73 |
+
dropout: float = 0.1
|
| 74 |
+
alpha_0: float = 0.25
|
| 75 |
+
noise_eps: float = 1e-3
|
| 76 |
+
diffusion_loss_proportion: float = 0.5
|
| 77 |
+
sequential_attn_mode: str = "mixed"
|
| 78 |
+
diffusion_attn_mode: str = "mixed"
|
| 79 |
+
sequential_shuffle: bool = False
|
| 80 |
+
diffusion_shuffle: bool = False
|
| 81 |
+
sampling_eps: float = 1e-3
|
| 82 |
+
time_conditioning: bool = False
|
| 83 |
+
norm_elementwise_affine: bool = True
|
| 84 |
+
norm_eps: float = 1e-6
|
| 85 |
+
T: int = 0
|
| 86 |
+
slotted_training: bool = True
|
| 87 |
+
ordered_sampling: bool = False
|
| 88 |
+
noise_sorting: bool = True
|
| 89 |
+
scale_by_batch: bool = False
|
| 90 |
+
unnormalized_loss: bool = False
|
| 91 |
+
simple_masking: bool = False
|
| 92 |
+
extra_processing: bool = False
|
| 93 |
+
sample_t_override: float = 0.0
|
| 94 |
+
sample_t_upper: float = 1.0
|
| 95 |
+
add_loss_path: bool = False
|
| 96 |
+
grouped_noise: bool = False
|
| 97 |
+
max_span_length: int = 50
|
| 98 |
+
if RopeParameters is not None:
|
| 99 |
+
rope_parameters: Optional[Union[RopeParameters, dict]] = None
|
| 100 |
+
else:
|
| 101 |
+
rope_theta: Optional[float] = 10000.0
|
| 102 |
+
rope_scaling: Optional[dict] = None
|
| 103 |
+
|
| 104 |
+
def __post_init__(self, **kwargs):
|
| 105 |
+
self.sliding_window = self.sliding_window if self.use_sliding_window else None
|
| 106 |
+
if self.num_key_value_heads is None:
|
| 107 |
+
self.num_key_value_heads = self.num_attention_heads
|
| 108 |
+
|
| 109 |
+
if self.layer_types is None:
|
| 110 |
+
self.layer_types = [
|
| 111 |
+
"sliding_attention"
|
| 112 |
+
if self.sliding_window is not None and i >= self.max_window_layers
|
| 113 |
+
else "full_attention"
|
| 114 |
+
for i in range(self.num_hidden_layers)
|
| 115 |
+
]
|
| 116 |
+
super().__post_init__(**kwargs)
|
| 117 |
+
|
| 118 |
+
def update_from_string(self, update_str: str):
|
| 119 |
+
super().update_from_string(update_str)
|
| 120 |
+
if self.layer_types is not None and len(self.layer_types) != self.num_hidden_layers:
|
| 121 |
+
self.layer_types = [
|
| 122 |
+
"sliding_attention"
|
| 123 |
+
if self.sliding_window is not None and i >= self.max_window_layers
|
| 124 |
+
else "full_attention"
|
| 125 |
+
for i in range(self.num_hidden_layers)
|
| 126 |
+
]
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
ZaryaConfig.register_for_auto_class("AutoConfig")
|
| 130 |
+
AutoConfig.register(ZaryaConfig.model_type, ZaryaConfig)
|
| 131 |
+
__all__ = ["ZaryaConfig"]
|
generation_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"T": 16,
|
| 3 |
+
"_from_model_config": false,
|
| 4 |
+
"adapter_kwargs": {},
|
| 5 |
+
"bos_token_id": 151644,
|
| 6 |
+
"diffusion_phase_only": false,
|
| 7 |
+
"do_sample": false,
|
| 8 |
+
"eos_token_id": [
|
| 9 |
+
151645,
|
| 10 |
+
151643
|
| 11 |
+
],
|
| 12 |
+
"from_tf": false,
|
| 13 |
+
"ignore_noise_schedule": false,
|
| 14 |
+
"pad_token_id": 151643,
|
| 15 |
+
"sequential_phase_only": false,
|
| 16 |
+
"slotted_generation": true,
|
| 17 |
+
"transformers_version": "5.12.1",
|
| 18 |
+
"trust_remote_code": true,
|
| 19 |
+
"unmask_probs_coef": 1,
|
| 20 |
+
"use_float64": false
|
| 21 |
+
}
|
generation_utils.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers.generation.configuration_utils import GenerationConfig
|
| 2 |
+
from transformers.utils import logging
|
| 3 |
+
|
| 4 |
+
logger = logging.get_logger(__name__)
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class ZaryaGenerationConfig(GenerationConfig):
|
| 8 |
+
model_type = "zarya"
|
| 9 |
+
ignore_noise_schedule: bool = False
|
| 10 |
+
|
| 11 |
+
def __init__(self, **kwargs):
|
| 12 |
+
super().__init__(**kwargs)
|
| 13 |
+
self.ignore_noise_schedule: bool = kwargs.pop("ignore_noise_schedule", False)
|
| 14 |
+
self.T: int = kwargs.pop("T", 1000)
|
| 15 |
+
self.use_float64: bool = kwargs.pop("use_float64", False)
|
| 16 |
+
self.sequential_phase_only: bool = kwargs.pop("sequential_phase_only", False)
|
| 17 |
+
self.diffusion_phase_only: bool = kwargs.pop("diffusion_phase_only", False)
|
| 18 |
+
self.unmask_probs_coef: float = kwargs.pop("unmask_probs_coef", 1)
|
| 19 |
+
self.slot_size: int = kwargs.pop("slot_size", 16)
|
| 20 |
+
self.serial_num_blocks: int = kwargs.pop("serial_num_blocks", 1)
|
| 21 |
+
self.slot_threshold: float = kwargs.pop("slot_threshold", 0.9)
|
| 22 |
+
self.token_threshold: float = kwargs.pop("token_threshold", 0.3)
|
| 23 |
+
|
| 24 |
+
# Validate the values of the attributes
|
| 25 |
+
self.validate(strict=True)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
__all__ = ["ZaryaGenerationConfig"]
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5cfad56b84f3aee103815df5e7a45a0292b83418628f9cc8e3a6eff00611b060
|
| 3 |
+
size 1192137888
|
modeling.py
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c8165c070bd7b1eff751f9cd82acf52c4636e997f2df755d01f4eac442a3108
|
| 3 |
+
size 11422843
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_prefix_space": false,
|
| 4 |
+
"added_tokens_decoder": {
|
| 5 |
+
"151643": {
|
| 6 |
+
"content": "<|endoftext|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false,
|
| 11 |
+
"special": true
|
| 12 |
+
},
|
| 13 |
+
"151644": {
|
| 14 |
+
"content": "<|im_start|>",
|
| 15 |
+
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false,
|
| 19 |
+
"special": true
|
| 20 |
+
},
|
| 21 |
+
"151645": {
|
| 22 |
+
"content": "<|im_end|>",
|
| 23 |
+
"lstrip": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
+
"rstrip": false,
|
| 26 |
+
"single_word": false,
|
| 27 |
+
"special": true
|
| 28 |
+
},
|
| 29 |
+
"151646": {
|
| 30 |
+
"content": "<|object_ref_start|>",
|
| 31 |
+
"lstrip": false,
|
| 32 |
+
"normalized": false,
|
| 33 |
+
"rstrip": false,
|
| 34 |
+
"single_word": false,
|
| 35 |
+
"special": true
|
| 36 |
+
},
|
| 37 |
+
"151647": {
|
| 38 |
+
"content": "<|object_ref_end|>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": false,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false,
|
| 43 |
+
"special": true
|
| 44 |
+
},
|
| 45 |
+
"151648": {
|
| 46 |
+
"content": "<|box_start|>",
|
| 47 |
+
"lstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false,
|
| 51 |
+
"special": true
|
| 52 |
+
},
|
| 53 |
+
"151649": {
|
| 54 |
+
"content": "<|box_end|>",
|
| 55 |
+
"lstrip": false,
|
| 56 |
+
"normalized": false,
|
| 57 |
+
"rstrip": false,
|
| 58 |
+
"single_word": false,
|
| 59 |
+
"special": true
|
| 60 |
+
},
|
| 61 |
+
"151650": {
|
| 62 |
+
"content": "<|quad_start|>",
|
| 63 |
+
"lstrip": false,
|
| 64 |
+
"normalized": false,
|
| 65 |
+
"rstrip": false,
|
| 66 |
+
"single_word": false,
|
| 67 |
+
"special": true
|
| 68 |
+
},
|
| 69 |
+
"151651": {
|
| 70 |
+
"content": "<|quad_end|>",
|
| 71 |
+
"lstrip": false,
|
| 72 |
+
"normalized": false,
|
| 73 |
+
"rstrip": false,
|
| 74 |
+
"single_word": false,
|
| 75 |
+
"special": true
|
| 76 |
+
},
|
| 77 |
+
"151652": {
|
| 78 |
+
"content": "<|vision_start|>",
|
| 79 |
+
"lstrip": false,
|
| 80 |
+
"normalized": false,
|
| 81 |
+
"rstrip": false,
|
| 82 |
+
"single_word": false,
|
| 83 |
+
"special": true
|
| 84 |
+
},
|
| 85 |
+
"151653": {
|
| 86 |
+
"content": "<|vision_end|>",
|
| 87 |
+
"lstrip": false,
|
| 88 |
+
"normalized": false,
|
| 89 |
+
"rstrip": false,
|
| 90 |
+
"single_word": false,
|
| 91 |
+
"special": true
|
| 92 |
+
},
|
| 93 |
+
"151654": {
|
| 94 |
+
"content": "<|vision_pad|>",
|
| 95 |
+
"lstrip": false,
|
| 96 |
+
"normalized": false,
|
| 97 |
+
"rstrip": false,
|
| 98 |
+
"single_word": false,
|
| 99 |
+
"special": true
|
| 100 |
+
},
|
| 101 |
+
"151655": {
|
| 102 |
+
"content": "<|image_pad|>",
|
| 103 |
+
"lstrip": false,
|
| 104 |
+
"normalized": false,
|
| 105 |
+
"rstrip": false,
|
| 106 |
+
"single_word": false,
|
| 107 |
+
"special": true
|
| 108 |
+
},
|
| 109 |
+
"151656": {
|
| 110 |
+
"content": "<|video_pad|>",
|
| 111 |
+
"lstrip": false,
|
| 112 |
+
"normalized": false,
|
| 113 |
+
"rstrip": false,
|
| 114 |
+
"single_word": false,
|
| 115 |
+
"special": true
|
| 116 |
+
},
|
| 117 |
+
"151657": {
|
| 118 |
+
"content": "<tool_call>",
|
| 119 |
+
"lstrip": false,
|
| 120 |
+
"normalized": false,
|
| 121 |
+
"rstrip": false,
|
| 122 |
+
"single_word": false,
|
| 123 |
+
"special": false
|
| 124 |
+
},
|
| 125 |
+
"151658": {
|
| 126 |
+
"content": "</tool_call>",
|
| 127 |
+
"lstrip": false,
|
| 128 |
+
"normalized": false,
|
| 129 |
+
"rstrip": false,
|
| 130 |
+
"single_word": false,
|
| 131 |
+
"special": false
|
| 132 |
+
},
|
| 133 |
+
"151659": {
|
| 134 |
+
"content": "<|fim_prefix|>",
|
| 135 |
+
"lstrip": false,
|
| 136 |
+
"normalized": false,
|
| 137 |
+
"rstrip": false,
|
| 138 |
+
"single_word": false,
|
| 139 |
+
"special": false
|
| 140 |
+
},
|
| 141 |
+
"151660": {
|
| 142 |
+
"content": "<|fim_middle|>",
|
| 143 |
+
"lstrip": false,
|
| 144 |
+
"normalized": false,
|
| 145 |
+
"rstrip": false,
|
| 146 |
+
"single_word": false,
|
| 147 |
+
"special": false
|
| 148 |
+
},
|
| 149 |
+
"151661": {
|
| 150 |
+
"content": "<|fim_suffix|>",
|
| 151 |
+
"lstrip": false,
|
| 152 |
+
"normalized": false,
|
| 153 |
+
"rstrip": false,
|
| 154 |
+
"single_word": false,
|
| 155 |
+
"special": false
|
| 156 |
+
},
|
| 157 |
+
"151662": {
|
| 158 |
+
"content": "<|fim_pad|>",
|
| 159 |
+
"lstrip": false,
|
| 160 |
+
"normalized": false,
|
| 161 |
+
"rstrip": false,
|
| 162 |
+
"single_word": false,
|
| 163 |
+
"special": false
|
| 164 |
+
},
|
| 165 |
+
"151663": {
|
| 166 |
+
"content": "<|repo_name|>",
|
| 167 |
+
"lstrip": false,
|
| 168 |
+
"normalized": false,
|
| 169 |
+
"rstrip": false,
|
| 170 |
+
"single_word": false,
|
| 171 |
+
"special": false
|
| 172 |
+
},
|
| 173 |
+
"151664": {
|
| 174 |
+
"content": "<|file_sep|>",
|
| 175 |
+
"lstrip": false,
|
| 176 |
+
"normalized": false,
|
| 177 |
+
"rstrip": false,
|
| 178 |
+
"single_word": false,
|
| 179 |
+
"special": false
|
| 180 |
+
},
|
| 181 |
+
"151665": {
|
| 182 |
+
"content": "<tool_response>",
|
| 183 |
+
"lstrip": false,
|
| 184 |
+
"normalized": false,
|
| 185 |
+
"rstrip": false,
|
| 186 |
+
"single_word": false,
|
| 187 |
+
"special": false
|
| 188 |
+
},
|
| 189 |
+
"151666": {
|
| 190 |
+
"content": "</tool_response>",
|
| 191 |
+
"lstrip": false,
|
| 192 |
+
"normalized": false,
|
| 193 |
+
"rstrip": false,
|
| 194 |
+
"single_word": false,
|
| 195 |
+
"special": false
|
| 196 |
+
},
|
| 197 |
+
"151667": {
|
| 198 |
+
"content": "<think>",
|
| 199 |
+
"lstrip": false,
|
| 200 |
+
"normalized": false,
|
| 201 |
+
"rstrip": false,
|
| 202 |
+
"single_word": false,
|
| 203 |
+
"special": false
|
| 204 |
+
},
|
| 205 |
+
"151668": {
|
| 206 |
+
"content": "</think>",
|
| 207 |
+
"lstrip": false,
|
| 208 |
+
"normalized": false,
|
| 209 |
+
"rstrip": false,
|
| 210 |
+
"single_word": false,
|
| 211 |
+
"special": false
|
| 212 |
+
},
|
| 213 |
+
"151669": {
|
| 214 |
+
"content": "<|mdm_mask|>",
|
| 215 |
+
"lstrip": false,
|
| 216 |
+
"normalized": false,
|
| 217 |
+
"rstrip": false,
|
| 218 |
+
"single_word": false,
|
| 219 |
+
"special": true
|
| 220 |
+
}
|
| 221 |
+
},
|
| 222 |
+
"additional_special_tokens": [
|
| 223 |
+
"<|im_start|>",
|
| 224 |
+
"<|im_end|>",
|
| 225 |
+
"<|object_ref_start|>",
|
| 226 |
+
"<|object_ref_end|>",
|
| 227 |
+
"<|box_start|>",
|
| 228 |
+
"<|box_end|>",
|
| 229 |
+
"<|quad_start|>",
|
| 230 |
+
"<|quad_end|>",
|
| 231 |
+
"<|vision_start|>",
|
| 232 |
+
"<|vision_end|>",
|
| 233 |
+
"<|vision_pad|>",
|
| 234 |
+
"<|image_pad|>",
|
| 235 |
+
"<|video_pad|>",
|
| 236 |
+
"<|mdm_mask|>"
|
| 237 |
+
],
|
| 238 |
+
"bos_token": "<|im_start|>",
|
| 239 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
|
| 240 |
+
"clean_up_tokenization_spaces": false,
|
| 241 |
+
"eos_token": "<|im_end|>",
|
| 242 |
+
"errors": "replace",
|
| 243 |
+
"is_local": true,
|
| 244 |
+
"local_files_only": false,
|
| 245 |
+
"mask_token": "<|mdm_mask|>",
|
| 246 |
+
"model_max_length": 131072,
|
| 247 |
+
"pad_token": "<|endoftext|>",
|
| 248 |
+
"split_special_tokens": false,
|
| 249 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 250 |
+
"unk_token": null
|
| 251 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|