Upload ZAYA1-8B-MXFP4 via jang-tools
Browse files- .gitattributes +1 -0
- README.md +110 -0
- chat_template.jinja +205 -0
- config.json +66 -0
- generation_config.json +7 -0
- jang_config.json +28 -0
- model-00001-of-00006.safetensors +3 -0
- model-00002-of-00006.safetensors +3 -0
- model-00003-of-00006.safetensors +3 -0
- model-00004-of-00006.safetensors +3 -0
- model-00005-of-00006.safetensors +3 -0
- model-00006-of-00006.safetensors +3 -0
- model.safetensors.index.json +0 -0
- osaurus-x-banner.png +0 -0
- special_tokens_map.json +33 -0
- tokenizer.json +3 -0
- tokenizer_config.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,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: mlx
|
| 4 |
+
base_model: Zyphra/ZAYA1-8B
|
| 5 |
+
base_model_relation: quantized
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- zaya
|
| 9 |
+
- mixture-of-experts
|
| 10 |
+
- hybrid-attention
|
| 11 |
+
- cca-attention
|
| 12 |
+
- mlx
|
| 13 |
+
- apple-silicon
|
| 14 |
+
- reasoning
|
| 15 |
+
- tool-use
|
| 16 |
+
- quantized
|
| 17 |
+
- mxfp4
|
| 18 |
+
- jang
|
| 19 |
+
- osaurus
|
| 20 |
+
quantization_config:
|
| 21 |
+
family: mxfp4
|
| 22 |
+
profile: MXFP4
|
| 23 |
+
group_size: 32
|
| 24 |
+
expert_layout: split_switch_mlp
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
<p align="center"><img src="osaurus-x-banner.png" width="100%" alt="OsaurusAI"/></p>
|
| 28 |
+
|
| 29 |
+
# ZAYA1-8B-MXFP4
|
| 30 |
+
|
| 31 |
+
Quantized **Zyphra/ZAYA1-8B** for Apple Silicon runtimes.
|
| 32 |
+
|
| 33 |
+
| | |
|
| 34 |
+
|---|---|
|
| 35 |
+
| Source | [Zyphra/ZAYA1-8B](https://huggingface.co/Zyphra/ZAYA1-8B) |
|
| 36 |
+
| License | Apache-2.0, inherited from upstream |
|
| 37 |
+
| Format | MXFP4 |
|
| 38 |
+
| Bundle size | 5.48 GiB |
|
| 39 |
+
| Tensor keys | 1965 |
|
| 40 |
+
| Expert layout | Pre-stacked `zaya_block.experts.switch_mlp` |
|
| 41 |
+
| Runtime status | Generation coherence: NOT INDEPENDENTLY PASSED for the quantized runtime bundle (coherence report did not pass); published as a format/runtime bundle pending downstream ZAYA runtime validation. |
|
| 42 |
+
|
| 43 |
+
## Important Runtime Note
|
| 44 |
+
|
| 45 |
+
This bundle requires a ZAYA-aware MLX/JANG runtime that implements CCA attention state and the converted pre-stacked expert layout.
|
| 46 |
+
|
| 47 |
+
ZAYA is not a stock `mlx_lm` architecture. It alternates CCA attention layers
|
| 48 |
+
and top-1 MoE layers. Use this bundle only with a runtime that implements the
|
| 49 |
+
ZAYA CCA state contract and the converted pre-stacked expert layout.
|
| 50 |
+
|
| 51 |
+
## Architecture Summary
|
| 52 |
+
|
| 53 |
+
- 80 decoder layers: 40 CCA attention layers and 40 top-1 MoE layers
|
| 54 |
+
- Hidden size 2048, 16 query heads, 2 KV heads, head dim 128
|
| 55 |
+
- CCA state per attention layer: standard KV plus `conv_state [B,1280,2]`
|
| 56 |
+
and `prev_hs [B,2048]`
|
| 57 |
+
- 16 routed experts per MoE layer, top-1 routing with MOD skip route
|
| 58 |
+
- Context length 131072, `rope_theta=5000000`
|
| 59 |
+
|
| 60 |
+
## Quantization
|
| 61 |
+
|
| 62 |
+
4-bit affine linears + 8-bit embeddings + passthrough router/CCA state tensors.
|
| 63 |
+
|
| 64 |
+
Passthrough floor for first release prep:
|
| 65 |
+
|
| 66 |
+
- `conv_qk.*`, `temp`, norms, residual scaling, router path, biases, and
|
| 67 |
+
balancing biases are preserved as float tensors.
|
| 68 |
+
- Embeddings and `lm_head` use 8-bit affine in the prepared bundles.
|
| 69 |
+
- `jangtq_runtime.safetensors` is not applicable to MXFP4.
|
| 70 |
+
|
| 71 |
+
`mxtq_bits`:
|
| 72 |
+
|
| 73 |
+
```json
|
| 74 |
+
null
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
## Bundle Verification
|
| 78 |
+
|
| 79 |
+
- Safetensor headers scanned.
|
| 80 |
+
- Source tensor coverage checked.
|
| 81 |
+
- Converted bundles checked for `local_experts` removal.
|
| 82 |
+
- Converted expert tensors checked for pre-stacked `switch_mlp` layout.
|
| 83 |
+
- JANGTQ sidecars checked for the Swift runtime contract.
|
| 84 |
+
- Runtime coherence status recorded above.
|
| 85 |
+
|
| 86 |
+
## Runtime Smoke Tests
|
| 87 |
+
|
| 88 |
+
Before production use, run short deterministic prompts through the exact target
|
| 89 |
+
runtime:
|
| 90 |
+
|
| 91 |
+
- `What is 2+2? Answer with only the number.`
|
| 92 |
+
- `What is the capital of France? Answer with one word.`
|
| 93 |
+
- One chat-template prompt with thinking disabled.
|
| 94 |
+
- One chat-template prompt with thinking enabled and enough output budget for
|
| 95 |
+
the final answer.
|
| 96 |
+
|
| 97 |
+
The first public bundle release records bundle integrity and runtime contract
|
| 98 |
+
checks. Full generation quality depends on a ZAYA-aware runtime implementation.
|
| 99 |
+
|
| 100 |
+
## Korean Summary
|
| 101 |
+
|
| 102 |
+
이 번들은 Zyphra/ZAYA1-8B를 Apple Silicon MLX/JANG 런타임용으로 양자화한 모델입니다. ZAYA의 CCA attention 상태와 MoE 라우팅을 정확히 구현한 런타임에서만 사용해야 합니다.
|
| 103 |
+
|
| 104 |
+
## Files
|
| 105 |
+
|
| 106 |
+
- `config.json` carries `weight_format=mxfp4` and
|
| 107 |
+
`zaya_expert_layout=split_switch_mlp`.
|
| 108 |
+
- `jang_config.json` carries `cache_subtype=zaya_cca`.
|
| 109 |
+
- Tokenizer files and `chat_template.jinja` are preserved from the upstream
|
| 110 |
+
source snapshot.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% macro render_extra_keys(json_dict, handled_keys) %}
|
| 2 |
+
{%- if json_dict is mapping %}
|
| 3 |
+
{%- for json_key in json_dict if json_key not in handled_keys %}
|
| 4 |
+
{%- if json_dict[json_key] is mapping or (json_dict[json_key] is sequence and json_dict[json_key] is not string) %}
|
| 5 |
+
{{- '\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | tojson | safe) ~ '</' ~ json_key ~ '>' }}
|
| 6 |
+
{%- else %}
|
| 7 |
+
{{-'\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | string) ~ '</' ~ json_key ~ '>' }}
|
| 8 |
+
{%- endif %}
|
| 9 |
+
{%- endfor %}
|
| 10 |
+
{%- endif %}
|
| 11 |
+
{% endmacro %}
|
| 12 |
+
{%- set enable_thinking = enable_thinking if enable_thinking is defined else True %}
|
| 13 |
+
{# TODO: set truncate to true for deployment & agent evals. Keep on for SFT. #}
|
| 14 |
+
{%- set truncate_history_thinking = truncate_history_thinking if truncate_history_thinking is defined else False %}
|
| 15 |
+
{{- bos_token }}
|
| 16 |
+
{%- set ns = namespace(last_user_idx = -1) %}
|
| 17 |
+
{%- set loop_messages = messages %}
|
| 18 |
+
{%- for m in loop_messages %}
|
| 19 |
+
{%- if m["role"] == "user" %}
|
| 20 |
+
{%- set ns.last_user_idx = loop.index0 %}
|
| 21 |
+
{%- endif %}
|
| 22 |
+
{%- endfor %}
|
| 23 |
+
|
| 24 |
+
{%- if messages[0]["role"] == "system" %}
|
| 25 |
+
{%- set system_message = messages[0]["content"] %}
|
| 26 |
+
{%- set loop_messages = messages[1:] %}
|
| 27 |
+
{%- else %}
|
| 28 |
+
{%- set system_message = "" %}
|
| 29 |
+
{%- set loop_messages = messages %}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{%- if not tools is defined %}
|
| 32 |
+
{%- set tools = [] %}
|
| 33 |
+
{%- endif %}
|
| 34 |
+
{# Recompute last_user_idx relative to loop_messages after handling system #}
|
| 35 |
+
{%- set ns = namespace(last_user_idx = -1) %}
|
| 36 |
+
{%- for m in loop_messages %}
|
| 37 |
+
{%- if m["role"] == "user" %}
|
| 38 |
+
{%- set ns.last_user_idx = loop.index0 %}
|
| 39 |
+
{%- endif %}
|
| 40 |
+
{%- endfor %}
|
| 41 |
+
{%- if system_message is defined %}
|
| 42 |
+
{{- "<|im_start|>system\n" + system_message }}
|
| 43 |
+
{%- else %}
|
| 44 |
+
{%- if tools is iterable and tools | length > 0 %}
|
| 45 |
+
{{- "<|im_start|>system\n" }}
|
| 46 |
+
{%- endif %}
|
| 47 |
+
{%- endif %}
|
| 48 |
+
{%- if tools is iterable and tools | length > 0 %}
|
| 49 |
+
{%- if system_message is defined and system_message | length > 0 %}
|
| 50 |
+
{{- "\n\n" }}
|
| 51 |
+
{%- endif %}
|
| 52 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n" }}
|
| 53 |
+
{{- "<tools>" }}
|
| 54 |
+
{%- for tool in tools %}
|
| 55 |
+
{%- if tool.function is defined %}
|
| 56 |
+
{%- set tool = tool.function %}
|
| 57 |
+
{%- endif %}
|
| 58 |
+
{{- "\n<function>\n<name>" ~ tool.name ~ "</name>" }}
|
| 59 |
+
{%- if tool.description is defined %}
|
| 60 |
+
{{- '\n<description>' ~ (tool.description | trim) ~ '</description>' }}
|
| 61 |
+
{%- endif %}
|
| 62 |
+
{{- '\n<parameters>' }}
|
| 63 |
+
{%- if tool.parameters is defined and tool.parameters is mapping and tool.parameters.properties is defined and tool.parameters.properties is mapping %}
|
| 64 |
+
{%- for param_name, param_fields in tool.parameters.properties|items %}
|
| 65 |
+
{{- '\n<parameter>' }}
|
| 66 |
+
{{- '\n<name>' ~ param_name ~ '</name>' }}
|
| 67 |
+
{%- if param_fields.type is defined %}
|
| 68 |
+
{{- '\n<type>' ~ (param_fields.type | string) ~ '</type>' }}
|
| 69 |
+
{%- endif %}
|
| 70 |
+
{%- if param_fields.description is defined %}
|
| 71 |
+
{{- '\n<description>' ~ (param_fields.description | trim) ~ '</description>' }}
|
| 72 |
+
{%- endif %}
|
| 73 |
+
{%- if param_fields.enum is defined %}
|
| 74 |
+
{{- '\n<enum>' ~ (param_fields.enum | tojson | safe) ~ '</enum>' }}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- set handled_keys = ['name', 'type', 'description', 'enum'] %}
|
| 77 |
+
{{- render_extra_keys(param_fields, handled_keys) }}
|
| 78 |
+
{{- '\n</parameter>' }}
|
| 79 |
+
{%- endfor %}
|
| 80 |
+
{%- endif %}
|
| 81 |
+
{% set handled_keys = ['type', 'properties', 'required'] %}
|
| 82 |
+
{{- render_extra_keys(tool.parameters, handled_keys) }}
|
| 83 |
+
{%- if tool.parameters is defined and tool.parameters.required is defined %}
|
| 84 |
+
{{- '\n<required>' ~ (tool.parameters.required | tojson | safe) ~ '</required>' }}
|
| 85 |
+
{%- endif %}
|
| 86 |
+
{{- '\n</parameters>' }}
|
| 87 |
+
{%- set handled_keys = ['type', 'name', 'description', 'parameters'] %}
|
| 88 |
+
{{- render_extra_keys(tool, handled_keys) }}
|
| 89 |
+
{{- '\n</function>' }}
|
| 90 |
+
{%- endfor %}
|
| 91 |
+
{{- "\n</tools>" }}
|
| 92 |
+
|
| 93 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<zyphra_tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</zyphra_tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <zyphra_tool_call></zyphra_tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 94 |
+
{%- endif %}
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
{%- if system_message is defined %}
|
| 98 |
+
{{- '<|im_end|>\n' }}
|
| 99 |
+
{%- else %}
|
| 100 |
+
{%- if tools is iterable and tools | length > 0 %}
|
| 101 |
+
{{- '<|im_end|>\n' }}
|
| 102 |
+
{%- endif %}
|
| 103 |
+
{%- endif %}
|
| 104 |
+
|
| 105 |
+
{%- for message in loop_messages %}
|
| 106 |
+
{%- if message.role == "assistant" %}
|
| 107 |
+
{# Add reasoning content in to content field for unified processing below. #}
|
| 108 |
+
{%- if message.reasoning_content is defined and message.reasoning_content is string and message.reasoning_content | trim | length > 0 %}
|
| 109 |
+
{%- set content = "<think>\n" ~ message.reasoning_content ~ "\n</think>\n\n" ~ (message.content | default('', true)) %}
|
| 110 |
+
{%- else %}
|
| 111 |
+
{%- set content = message.content | default('', true) %}
|
| 112 |
+
{%- if content is string -%}
|
| 113 |
+
{# Allow downstream logic to to take care of broken thought, only handle coherent reasoning here. #}
|
| 114 |
+
{%- if '<think>' not in content and '</think>' not in content -%}
|
| 115 |
+
{%- set content = "<think>\n</think>\n\n" ~ content -%}
|
| 116 |
+
{%- endif -%}
|
| 117 |
+
{%- else -%}
|
| 118 |
+
{%- set content = content -%}
|
| 119 |
+
{%- endif -%}
|
| 120 |
+
{%- endif %}
|
| 121 |
+
{%- if message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}
|
| 122 |
+
{# Assistant message has tool calls. #}
|
| 123 |
+
{{- '<|im_start|>assistant\n' }}
|
| 124 |
+
{%- set include_content = not (truncate_history_thinking and loop.index0 < ns.last_user_idx) %}
|
| 125 |
+
{%- if content is string and content | trim | length > 0 %}
|
| 126 |
+
{%- if include_content %}
|
| 127 |
+
{{- (content | trim) ~ '\n\n' -}}
|
| 128 |
+
{%- else %}
|
| 129 |
+
{%- set c = (content | string) %}
|
| 130 |
+
{%- if '</think>' in c %}
|
| 131 |
+
{# Keep only content after the last closing think. Also generation prompt causes this. #}
|
| 132 |
+
{%- set c = c.split('</think>')[-1] %}
|
| 133 |
+
{%- elif '<think>' in c %}
|
| 134 |
+
{# If <think> was opened but never closed, drop the trailing think segment #}
|
| 135 |
+
{%- set c = c.split('<think>')[0] %}
|
| 136 |
+
{%- endif %}
|
| 137 |
+
{%- set c = "<think>\n</think>\n\n" ~ c | trim %}
|
| 138 |
+
{%- if c | length > 0 %}
|
| 139 |
+
{{- c ~ '\n' -}}
|
| 140 |
+
{%- endif %}
|
| 141 |
+
{%- endif %}
|
| 142 |
+
{%- else %}
|
| 143 |
+
{{- "<think>\n</think>\n\n" -}}
|
| 144 |
+
{%- endif %}
|
| 145 |
+
{%- for tool_call in message.tool_calls %}
|
| 146 |
+
{%- if tool_call.function is defined %}
|
| 147 |
+
{%- set tool_call = tool_call.function %}
|
| 148 |
+
{%- endif %}
|
| 149 |
+
{{- '<zyphra_tool_call>\n<function=' ~ tool_call.name ~ '>\n' -}}
|
| 150 |
+
{%- if tool_call.arguments is defined %}
|
| 151 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 152 |
+
{{- '<parameter=' ~ args_name ~ '>\n' -}}
|
| 153 |
+
{%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
|
| 154 |
+
{{- args_value ~ '\n</parameter>\n' -}}
|
| 155 |
+
{%- endfor %}
|
| 156 |
+
{%- endif %}
|
| 157 |
+
{{- '</function>\n</zyphra_tool_call>\n' -}}
|
| 158 |
+
{%- endfor %}
|
| 159 |
+
{{- '<|im_end|>\n' }}
|
| 160 |
+
{%- else %}
|
| 161 |
+
{# Assistant message doesn't have tool calls. #}
|
| 162 |
+
{%- if not (truncate_history_thinking and loop.index0 < ns.last_user_idx) %}
|
| 163 |
+
{{- '<|im_start|>assistant\n' ~ (content | default('', true) | string | trim) ~ '<|im_end|>\n' }}
|
| 164 |
+
{%- else %}
|
| 165 |
+
{%- set c = (content | default('', true) | string) %}
|
| 166 |
+
{%- if '<think>' in c and '</think>' in c %}
|
| 167 |
+
{%- set c = "<think>\n</think>\n\n" ~ (c.split('</think>')[-1] | trim) %}
|
| 168 |
+
{%- endif %}
|
| 169 |
+
{%- set c = c | trim %}
|
| 170 |
+
{%- if c | length > 0 %}
|
| 171 |
+
{{- '<|im_start|>assistant\n' ~ c ~ '<|im_end|>\n' }}
|
| 172 |
+
{%- else %}
|
| 173 |
+
{{- '<|im_start|>assistant\n<|im_end|>\n' }}
|
| 174 |
+
{%- endif %}
|
| 175 |
+
{%- endif %}
|
| 176 |
+
{%- endif %}
|
| 177 |
+
{%- elif message.role == "user" or message.role == "system" %}
|
| 178 |
+
{{- '<|im_start|>' + message.role + '\n' }}
|
| 179 |
+
{%- set content = message.content | string %}
|
| 180 |
+
{{- content }}
|
| 181 |
+
{{- '<|im_end|>\n' }}
|
| 182 |
+
{%- elif message.role == "tool" %}
|
| 183 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 184 |
+
{{- '<|im_start|>user\n' }}
|
| 185 |
+
{%- endif %}
|
| 186 |
+
{{- '<zyphra_tool_response>\n' }}
|
| 187 |
+
{{- message.content }}
|
| 188 |
+
{{- '\n</zyphra_tool_response>\n' }}
|
| 189 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 190 |
+
{{- '<|im_end|>\n' }}
|
| 191 |
+
{%- elif loop.last %}
|
| 192 |
+
{{- '<|im_end|>\n' }}
|
| 193 |
+
{%- endif %}
|
| 194 |
+
{%- else %}
|
| 195 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>\n' }}
|
| 196 |
+
{%- endif %}
|
| 197 |
+
{%- endfor %}
|
| 198 |
+
|
| 199 |
+
{%- if add_generation_prompt %}
|
| 200 |
+
{%- if enable_thinking %}
|
| 201 |
+
{{- '<|im_start|>assistant\n<think>\n' }}
|
| 202 |
+
{%- else %}
|
| 203 |
+
{{- '<|im_start|>assistant\n<think>\n</think>\n\n' }}
|
| 204 |
+
{%- endif %}
|
| 205 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_func": "swiglu",
|
| 3 |
+
"activation_func_fp8_input_store": false,
|
| 4 |
+
"add_bias_linear": false,
|
| 5 |
+
"architectures": [
|
| 6 |
+
"ZayaForCausalLM"
|
| 7 |
+
],
|
| 8 |
+
"attention_bias": false,
|
| 9 |
+
"attention_dropout": 0.0,
|
| 10 |
+
"bias_activation_fusion": true,
|
| 11 |
+
"bos_token_id": 2,
|
| 12 |
+
"cca": true,
|
| 13 |
+
"cca_num_q_heads": 8,
|
| 14 |
+
"dtype": "bfloat16",
|
| 15 |
+
"eos_token_id": 106,
|
| 16 |
+
"ffn_hidden_size": 4096,
|
| 17 |
+
"gated_linear_unit": true,
|
| 18 |
+
"hidden_size": 2048,
|
| 19 |
+
"kv_channels": 128,
|
| 20 |
+
"lm_head_bias": false,
|
| 21 |
+
"mamba_cache_dtype": "float32",
|
| 22 |
+
"max_position_embeddings": 131072,
|
| 23 |
+
"model_type": "zaya",
|
| 24 |
+
"moe_router_topk": 1,
|
| 25 |
+
"norm_epsilon": 1e-05,
|
| 26 |
+
"normalization": "RMSNorm",
|
| 27 |
+
"num_attention_heads": 16,
|
| 28 |
+
"num_experts": 16,
|
| 29 |
+
"num_hidden_layers": 80,
|
| 30 |
+
"num_key_value_heads": 2,
|
| 31 |
+
"num_query_groups": 2,
|
| 32 |
+
"pad_token_id": 0,
|
| 33 |
+
"partial_rotary_factor": 0.5,
|
| 34 |
+
"residual_in_fp32": true,
|
| 35 |
+
"rope_scaling": false,
|
| 36 |
+
"rope_theta": 5000000,
|
| 37 |
+
"scale_residual_merge": true,
|
| 38 |
+
"sliding_window": null,
|
| 39 |
+
"transformers_version": "4.57.1",
|
| 40 |
+
"use_cache": true,
|
| 41 |
+
"vocab_size": 262272,
|
| 42 |
+
"zaya_mlp_expansion": 256,
|
| 43 |
+
"zaya_use_eda": true,
|
| 44 |
+
"zaya_use_mod": true,
|
| 45 |
+
"weight_format": "mxfp4",
|
| 46 |
+
"zaya_expert_layout": "split_switch_mlp",
|
| 47 |
+
"tie_word_embeddings": true,
|
| 48 |
+
"quantization": {
|
| 49 |
+
"bits": 4,
|
| 50 |
+
"group_size": 32,
|
| 51 |
+
"mode": "affine",
|
| 52 |
+
"embed_bits": 8,
|
| 53 |
+
"router_bits": 16,
|
| 54 |
+
"expert_layout": "split_switch_mlp"
|
| 55 |
+
},
|
| 56 |
+
"capabilities": {
|
| 57 |
+
"reasoning_parser": "qwen3",
|
| 58 |
+
"tool_parser": "zaya_xml",
|
| 59 |
+
"think_in_template": true,
|
| 60 |
+
"supports_tools": true,
|
| 61 |
+
"supports_thinking": true,
|
| 62 |
+
"family": "zaya",
|
| 63 |
+
"modality": "text",
|
| 64 |
+
"cache_type": "hybrid"
|
| 65 |
+
}
|
| 66 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"eos_token_id": 106,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.57.1"
|
| 7 |
+
}
|
jang_config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 2,
|
| 3 |
+
"weight_format": "mxfp4",
|
| 4 |
+
"profile": "MXFP4",
|
| 5 |
+
"cache_subtype": "zaya_cca",
|
| 6 |
+
"source_model": {
|
| 7 |
+
"name": "ZAYA1-8B",
|
| 8 |
+
"org": "Zyphra",
|
| 9 |
+
"architecture": "zaya"
|
| 10 |
+
},
|
| 11 |
+
"expert_layout": "split_switch_mlp",
|
| 12 |
+
"quantization": {
|
| 13 |
+
"method": "affine",
|
| 14 |
+
"group_size": 32,
|
| 15 |
+
"bits": 4,
|
| 16 |
+
"embed_bits": 8
|
| 17 |
+
},
|
| 18 |
+
"capabilities": {
|
| 19 |
+
"reasoning_parser": "qwen3",
|
| 20 |
+
"tool_parser": "zaya_xml",
|
| 21 |
+
"think_in_template": true,
|
| 22 |
+
"supports_tools": true,
|
| 23 |
+
"supports_thinking": true,
|
| 24 |
+
"family": "zaya",
|
| 25 |
+
"modality": "text",
|
| 26 |
+
"cache_type": "hybrid"
|
| 27 |
+
}
|
| 28 |
+
}
|
model-00001-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2a6c1353ba873dc0e90ef202a26243b11b9f034f6cb6b07bbb37afb99f4437c
|
| 3 |
+
size 1018018312
|
model-00002-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3720d5fb64d76525cf3c25a6c3cb4ae0edabc3585fd21877472ddf9d60137008
|
| 3 |
+
size 1006642912
|
model-00003-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02084bebef2348c97b0085bad90ee4e9fcfa53bad66511624c1c9584129b6a73
|
| 3 |
+
size 1006642944
|
model-00004-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:af7aa7765edef974db93ae47313db89722e71a0014f4c5e37c0d422ed3b74ba4
|
| 3 |
+
size 1006642944
|
model-00005-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b1ef2438c86cac955f9b8c0069a18dc485f36500c24074c2de0d5578a7894199
|
| 3 |
+
size 1006642944
|
model-00006-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1c5c7ea17cf64d3aec7a3e22ded4c9ee065b6feaf1551145d65e6fb8ce06f9e
|
| 3 |
+
size 805314552
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
osaurus-x-banner.png
ADDED
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"boi_token": "<start_of_image>",
|
| 3 |
+
"bos_token": {
|
| 4 |
+
"content": "<bos>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false
|
| 9 |
+
},
|
| 10 |
+
"eoi_token": "<end_of_image>",
|
| 11 |
+
"eos_token": {
|
| 12 |
+
"content": "<|im_end|>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false
|
| 17 |
+
},
|
| 18 |
+
"image_token": "<image_soft_token>",
|
| 19 |
+
"pad_token": {
|
| 20 |
+
"content": "<pad>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false
|
| 25 |
+
},
|
| 26 |
+
"unk_token": {
|
| 27 |
+
"content": "<unk>",
|
| 28 |
+
"lstrip": false,
|
| 29 |
+
"normalized": false,
|
| 30 |
+
"rstrip": false,
|
| 31 |
+
"single_word": false
|
| 32 |
+
}
|
| 33 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29299fe0a5dfb9f41cacc71436a714a412e1163858fbf7085b84adbf9544133a
|
| 3 |
+
size 33385481
|
tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|