初始化项目,由ModelHub XC社区提供模型

Model: dinadina/GigaChat3-10B-A1.8B-bf16
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-04 10:12:16 +08:00
commit 039fd57b4d
21 changed files with 6156 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text

21
LICENSE.txt Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Salute Developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

175
README.md Normal file
View File

@@ -0,0 +1,175 @@
---
license: mit
language:
- ru
- en
pipeline_tag: text-generation
tags:
- moe
---
# GigaChat3-10B-A1.8B
Представляем `GigaChat3-10B-A1.8B` — диалоговую модель семейства GigaChat. Модель основана на архитектуре Mixture-of-Experts (MoE) с 10B общих и 1.8B активных параметров.
Архитектура включает **Multi-head Latent Attention (MLA)** и **Multi-Token Prediction (MTP)**, за счет чего модель оптимизирована для высокой пропускной способности (throughput) при инференсе.
Модель обучена поверх нашей базовой версии ([GigaChat3-10B-A1.8B-base](https://huggingface.co/ai-sage/GigaChat3-10B-A1.8B-base)) с помощью высококачественных SFT-данных.
Для высокопроизводительного инференса доступна версия модели в fp8 — [GigaChat3-10B-A1.8B-fp8](https://huggingface.co/ai-sage/GigaChat3-10B-A1.8B-fp8).
Поддерживает контекст до 256 тысяч токенов.
Больше подробностей [в хабр статье](https://habr.com/en/companies/sberdevices/articles/968904/).
## Архитектура модели
`GigaChat3-10B-A1.8B` использует кастомную MoE-архитектуру:
### Multi-head Latent Attention (MLA)
Вместо стандартного Multi-head Attention модель использует MLA. MLA обеспечивает эффективный инференс за счет сжатия Key-Value (KV) кэша в латентный вектор, что значительно снижает требования к памяти и ускоряет обработку.
### Multi-Token Prediction (MTP)
Модель обучена с использованием задачи Multi-Token Prediction (MTP). Это позволяет модели предсказывать несколько токенов за один проход, что ускоряет генерацию до 40% с помощью техник спекулятивной/параллельной генерации.
## Данные для обучения
Модель обучена на 20Т токенов.
Мы добавили 10 языков — от китайского и арабского до узбекского и казахского, а также расширили набор источников: книги, академические данные, датасеты по коду и математике. Все данные проходят дедупликацию, языковую фильтрацию и автоматические проверки качества при помощи эвристик и классификаторов.
Ключевой вклад в качество внесла синтетика: мы сгенерировали около 5,5 триллионов токенов синтетических данных. В корпус входят вопросы-ответы к текстам, цепочки reverse-prompt для структурирования данных, LLM-заметки с комментариями от модели внутри текстов, миллионы синтетических задач с решениями по математике и олимпиадному программированию (с синтетическими тестами) на основе PromptCot.
## Инференс
Одно из ключевых преимуществ `GigaChat3-10B-A1.8B` — скорость инференса. Модель (особенно в режиме MTP) демонстрирует пропускную способность, сопоставимую с пропускной способностью значительно меньших denseмоделей.
Мы измеряли с помощью vLLM v0.11.0, на типе bfloat16 c `batch_size=1`.
[Ссылка на код.](https://gist.github.com/ajpqs/ce941aa6f0f48ef36a65cb87a2a1d726)
|**Модель**|**request_throughput**|**output_throughput**|**total_token_throughput**|**mean_ttft_ms**|
|---|---|---|---|---|
|`Qwen3-1.7B`|1.689|357.308|726.093|11.824|
|**`mtp-GigaChat3-10B-A1.8B-base`**|**1.533**|**333.620**|**678.894**|**26.345**|
|**`GigaChat3-10B-A1.8B-base`**|**1.077**|**234.363**|**476.912**|**31.053**|
|`Qwen3-4B`|0.978|206.849|420.341|14.947|
|`Qwen3-8B`|0.664|140.432|285.375|16.663|
|`YandexGPT-5-Lite-8B-pretrain`|0.641|147.305|300.269|16.711|
## Бенчмарки
Хотя модель имеет 10 миллиардов параметров, её прямые аналоги — модели размером 34 миллиарда параметров. Однако благодаря высокой скорости генерации мы также сравниваем её с ещё более компактными моделями.
| Метрика | GigaChat 3 Lightning | Qwen3-1.7B-Instruct | Qwen3-4B-Instruct-2507 | SmolLM3 |
| ------------------------- | ---------------------: | -----------------------: | ---------------------: | ------: |
| MMLU_RU_FIVE_SHOT | **0.6833** | 0.4876 | 0.5972 | 0.4998 |
| RUBQ_ZERO_SHOT | **0.6516** | 0.2557 | 0.3170 | 0.6363 |
| MMLU_PRO_EN_FIVE_SHOT | 0.6061 | 0.410 | **0.6849** | 0.5013 |
| MMLU_EN_FIVE_SHOT | **0.7403** | 0.60 | 0.7080 | 0.5992 |
| BBH_THREE_SHOT | 0.4525 | 0.3317 | **0.7165** | 0.4161 |
| SuperGPQA | 0.2731 | 0.2092 | **0.3745** | 0.2459 |
| MATH_500_FOUR_SHOT | 0.7000 | 0.7520 | **0.8880** | 0.8020 |
| GPQA_COT_ZERO_SHOT | 0.3502 | 0.2651 | **0.5370** | 0.3704 |
| LiveCodeBench_ZERO_SHOT | 0.2031 | 0.0794 | **0.3046** | 0.1656 |
| HUMAN_EVAL_PLUS_ZERO_SHOT | 0.6951 | 0.6280 | **0.8780** | 0.7012 |
## Как проверить метрики модели
```shell
# lm-eval[api]==0.4.9.1
# sglang[all]==0.5.5
# или
# vllm==0.11.2
export HF_ALLOW_CODE_EVAL=1
# sglang server up
# 10B
python -m sglang.launch_server --model-path <path_to_model> --host 127.0.0.1 --port 30000 --dtype auto --mem-fraction-static 0.88 --trust-remote-code --allow-auto-truncate --speculative-algorithm EAGLE --speculative-num-steps 1 --speculative-eagle-topk 1 --speculative-num-draft-tokens 2
# mmlu pro check
python -m lm_eval --model sglang-generate --output_path <path_to_model> --batch_size 16 --model_args base_url=http://127.0.0.1:30000/generate,num_concurrent=16,tokenized_requests=True,max_length=131072,tokenizer=<path_to_model> --trust_remote_code --confirm_run_unsafe_code --num_fewshot 5 --tasks mmlu_pro
```
## Пример использования (Quickstart)
### 1. `transformers`
```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
model_name = "ai-sage/GigaChat3-10B-A1.8B-bf16"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
model.generation_config = GenerationConfig.from_pretrained(model_name)
messages = [
{"role": "user", "content": "Докажи теорему о неподвижной точке"}
]
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(input_tensor.to(model.device), max_new_tokens=1000)
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=False)
print(result)
```
### 2. `vLLM`
Запуск сервера
```shell
vllm serve ai-sage/GigaChat3-10B-A1.8B-bf16 \
--dtype "auto" \
--speculative-config '{"method": "mtp", "num_speculative_tokens": 1, "disable_padded_drafter_batch": false}'
```
Пример запроса
```shell
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "ai-sage/GigaChat3-10B-A1.8B-bf16",
"messages": [
{
"role": "user",
"content": "Докажи теорему о неподвижной точке"
}
],
"max_tokens": 400,
"temperature": 0
}'
```
### 3. `SGLang`
Запуск сервера
```shell
python -m sglang.launch_server \
--model-path ai-sage/GigaChat3-10B-A1.8B-bf16 \
--host 0.0.0.0 \
--port 30000 \
--dtype auto \
--mem-fraction-static 0.88 \
--speculative-algorithm EAGLE \
--speculative-num-steps 1 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 2
```
Пример запроса
```shell
curl http://localhost:30000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "ai-sage/GigaChat3-10B-A1.8B-bf16",
"messages": [
{
"role": "user",
"content": "Докажи теорему о неподвижной точке"
}
],
"max_tokens": 1000,
"temperature": 0
}'
```

357
chat_template.jinja Normal file
View File

@@ -0,0 +1,357 @@
{#--------TOOL RENDERING FUNCTIONS---------#}
{#---------------------------------------------------------------
Converts JSON Schema (dict) to a TypeScript type definition
----------------------------------------------------------------#}
{%- macro json_schema_to_typescript(schema, indent="", indent_factor=2) -%}
{%- set ADDITIONAL_JSON_KEYS = ['format', 'maxItems', 'maximum', 'minItems', 'minimum', 'pattern'] -%}
{%- set ty = schema.get("type") -%}
{# ---------------- OBJECT ---------------- #}
{%- if ty == "object" -%}
{{- "{\n" -}}
{# Start building property list #}
{%- set props = schema.get("properties", {}) -%}
{%- set required = schema.get("required", []) -%}
{%- set has_additional_props = schema.get("additionalProperties") is defined -%}
{%- set additional_props_type = none -%}
{%- if has_additional_props -%}
{%- if schema.additionalProperties == true -%}
{%- set additional_props_type = {'type': 'any'} -%}
{%- elif schema.additionalProperties is mapping -%}
{%- set additional_props_type = schema.additionalProperties -%}
{%- endif -%}
{%- endif -%}
{%- for key, val in props.items() -%}
{# ---------- Description Comments ---------- #}
{%- if "description" in val -%}
{%- for line in val['description'].splitlines() -%}
{%- if line.strip() -%}
{{- indent + '// ' + line + '\n' -}}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{# ---------- Additional JSON Keys ---------- #}
{%- for add_key, add_val in val.items() -%}
{%- if add_key in ADDITIONAL_JSON_KEYS -%}
{%- if add_val is string -%}
{{- indent + '// ' + add_key + ': "' + add_val + '"' + '\n' -}}
{%- else -%}
{{- indent + '// ' + add_key + ': ' ~ add_val ~ '\n' -}}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{# ---------- Property Definition ---------- #}
{%- set type_str = json_schema_to_typescript(
val,
indent + (' ' * indent_factor),
indent_factor
) -%}
{{- indent + key + ('' if key in required else '?') + ': ' + type_str + ',' -}}
{%- if "default" in val or "defalut_value" in val -%}
{%- set default = val.get("default", val.get("defalut_value")) -%}
{%- if default is string -%}
{{- ' // default: "' + default + '"' -}}
{%- else -%}
{{- ' // default: ' ~ default -}}
{%- endif -%}
{%- endif -%}
{{- "\n" -}}
{%- endfor -%}
{# Handle additionalProperties as index signature #}
{%- if has_additional_props and additional_props_type is not none -%}
{%- set additional_type_str = json_schema_to_typescript(
additional_props_type,
indent + (' ' * indent_factor),
indent_factor
) -%}
{{- indent + '[key: string]: ' + additional_type_str + '\n' -}}
{%- endif -%}
{{- indent[:-indent_factor] + '}' -}}
{# ---------------- STRING ---------------- #}
{%- elif ty == "string" -%}
{%- if schema.get("enum") -%}
{%- set ns = namespace(enum = []) -%}
{%- for en in schema['enum'] -%}
{%- set ns.enum = ns.enum + ['"' ~ en ~ '"'] -%}
{%- endfor -%}
{{- ns.enum | join(' | ') -}}
{%- elif schema.get("format") in ['date-time', 'date'] -%}
{{- 'Date' -}}
{%- else -%}
{{- 'string' -}}
{%- endif -%}
{# ---------------- NUMBER / INTEGER ---------------- #}
{%- elif ty in ["number", "integer"] -%}
{%- if schema.get("enum") -%}
{{- schema.enum | join(' | ') -}}
{%- else -%}
{{- 'number' -}}
{%- endif -%}
{# ---------------- BOOLEAN ---------------- #}
{%- elif ty == "boolean" -%}
{{- 'boolean' -}}
{# ---------------- ARRAY ---------------- #}
{%- elif ty == "array" -%}
{%- if "items" in schema -%}
{{- json_schema_to_typescript(schema['items'], indent, indent_factor) + '[]' -}}
{%- else -%}
{{- 'Array<any>' -}}
{%- endif -%}
{# ---------------- FALLBACK ---------------- #}
{%- else -%}
{{- 'any' -}}
{%- endif -%}
{%- endmacro -%}
{#---------------------------------------------------------------
Renders a namespace and its tool definitions in TypeScript style
----------------------------------------------------------------#}
{%- macro render_tool_namespace(namespace_name, tools) -%}
{%- set ns = namespace(sections = ['namespace ' ~ namespace_name ~ ' {']) -%}
{%- for tool in tools -%}
{%- if tool.function -%}
{%- set tool = tool.function -%}
{%- endif -%}
{%- set ns_tool = namespace(content_lines=[]) -%}
{# ---------- TOOL DESCRIPTION ---------- #}
{%- if tool.get('description') -%}
{%- for line in tool['description'].splitlines() -%}
{%- if line.strip() -%}
{%- set ns_tool.content_lines = ns_tool.content_lines + ['// ' ~ line] -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{# ---------- TOOL SIGNATURE ---------- #}
{%- set main_body = "" -%}
{%- set params = tool.get("parameters") -%}
{%- if params and params.get("properties") -%}
{%- set param_type = json_schema_to_typescript(params, " ") -%}
{%- set main_body = 'type ' ~ tool.name ~ ' = (_: ' ~ param_type ~ ') => ' -%}
{%- else -%}
{%- set main_body = 'type ' ~ tool.name ~ ' = () => ' -%}
{%- endif -%}
{# ---------- RETURN TYPE ---------- #}
{%- set return_params = tool.get("return_parameters") -%}
{%- if return_params and return_params.get("properties") -%}
{%- set return_type = json_schema_to_typescript(return_params, " ") -%}
{%- set main_body = main_body ~ return_type -%}
{%- else -%}
{%- set main_body = main_body ~ 'any' -%}
{%- endif -%}
{%- set main_body = main_body ~ ';\n' -%}
{%- set ns_tool.content_lines = ns_tool.content_lines + [main_body] -%}
{# ---------- ADD TOOL TO SECTIONS ---------- #}
{%- set ns.sections = ns.sections + [ns_tool.content_lines | join('\n')] -%}
{%- endfor -%}
{%- set ns.sections = ns.sections + ['} // namespace ' ~ namespace_name] -%}
{{- ns.sections | join('\n') -}}
{%- endmacro -%}
{# ----------- MESSAGE RENDERING HELPER FUNCTIONS ------------ #}
{%- macro render_role_message(message, role=None) -%}
{%- if not role -%}
{%- set role = message["role"] -%}
{%- endif -%}
{%- set message_content = message['content'] or '' -%}
{%- if message_content is not string -%}
{%- set message_content = message_content | tojson(ensure_ascii=False) -%}
{%- endif -%}
{{- role + add_tokens.role_sep + message_content + add_tokens.message_sep -}}
{%- endmacro -%}
{%- macro render_function_call(message) -%}
{%- set call = message['content'] -%}
{%- if call.function -%}
{%- set call = call.function -%}
{%- endif -%}
{%- set arguments = call['arguments'] -%}
{%- if arguments is not string -%}
{%- set arguments = arguments| tojson(ensure_ascii=False) -%}
{%- endif -%}
{{- render_role_message(
{
'role': 'function call',
'content': '{"name": "' ~ call['name'] ~ '", "arguments": ' ~ arguments ~ '}'
}
) -}}
{%- endmacro -%}
{# ----- SPECIAL TOKENS ----- #}
{%- set add_tokens = namespace(
role_sep="<|role_sep|>\n",
message_sep="<|message_sep|>\n\n"
) -%}
{# ----- DEFAULT DEVSYSTEM ----- #}
{%- set DEVSYSTEM -%}
<role_description>
Description of the roles available in the dialog.
`developer system`
A message added by Sber before the main dialog. It has the highest priority and sets global, non-overridable conditions (for example, conversation rules, the safety policy, the assistant's overall response style, etc.).
`system`
A system instruction added by developers or by the user, but with a lower priority than `developer system`. It usually describes the assistant's instructions, a specific response style, and other conditions for this particular dialog.
`user`
A message or request from the user. The assistant follows it if it does not conflict with higher-priority instructions (see <instruction_priority>).
`user memory`
A sequence of the most up-to-date long-term facts about the user at the time of their request, presented as a JSON list of strings. Facts are listed in chronological order, meaning newer facts are appended to the end of the sequence. When facts are changed or deleted, records of previous facts remain in the sequence. The assistant saves facts using a function and uses them in accordance with the <memory_guidelines> block below.
`added files`
Metadata about files available for use in the dialog, presented in JSON format. It contains the following keys: id (a unique file identifier), name (file name), type (file type).
`assistant`
The assistant's reply to the user's request. If the system instruction or the user does not set additional rules for `assistant`, this reply must comply with the instructions in the <assistant_guidelines> block below. The list of functions available to call is contained in `function descriptions`. The name of the required function and its arguments will be generated next by the `function call` role. In its replies, the assistant follows the instructions in accordance with <instruction_priority>.
`function descriptions`
Function descriptions in TypeScript format. A function is a special tool (or a set of instructions) that the assistant can call to perform specific actions, computations, or obtain data needed to solve the user's task. Each function description contains blocks with the name, description, and arguments. Sometimes the description contains separate blocks with return parameters and usage examples that illustrate the correct call and arguments.
`function call`
The function that `assistant` calls based on the dialog context, and its arguments. The function is invoked in strict accordance with the instructions in the <function_usage> block.
`function result`
The result of the last function call.
</role_description>
<available_modalities>
The assistant can work with the following modalities: text, available functions.
</available_modalities>
<instruction_priority>
If instructions from different roles conflict within the dialog context, observe the following priorities:
`developer system` > `system` > `user` > `function descriptions` > `function result` > `user memory`
</instruction_priority>
<function_usage>
Basic instructions for working with functions.
Only call those functions that are described in `function descriptions`.
Call available functions when, according to their description, such a call will help provide a more complete and/or accurate answer to the user's request. Fill in function arguments using information from the dialog context. If a function could help answer the request but a required argument is missing from the context, ask the user for the missing data before calling the function. If a necessary function is unavailable or an error occurs, briefly inform the user and, if possible, suggest an alternative.
</function_usage>
<memory_guidelines>
Rules for using facts in long-term memory:
If there is no message under the `user memory` role in the dialog, this is equivalent to the absence of long-term facts about the user in memory. In that case, information about the user is limited to the current dialog, and no new facts should be saved.
</memory_guidelines>
<assistant_guidelines>
You are a helpful assistant.
# Instructions
- Strictly follow the instruction priority.
- Maintain a logical chain of reasoning when answering the user's question.
- For complex questions (for example, STEM), try to answer in detail unless the system message or dialog context limits the response length.
- Be helpful, truthful, and avoid unsafe or prohibited content in your responses.
- Try to reply in the language in which the user asked their question.
</assistant_guidelines>
A dialog will follow below.
The dialog may include various roles described in the <role_description> block.
Each turn begins with the role name and a special token that marks the end of the role's full name, and ends with a special end-of-turn token.
Your task is to continue the dialog from the last specified role in accordance with the dialog context.
{%- endset -%}
{#- ---------------------- RENDERING STARTS HERE ---------------------- -#}
{# ----- RENDER BOS TOKEN ----- #}
{{- bos_token -}}
{# ----- RENDER DEVSYSTEM ----- #}
{{- render_role_message({"role": "developer system", "content": DEVSYSTEM}) -}}
{# ----- RENDER SYSTEM IF PRESENT ----- #}
{%- if messages and messages[0]['role'] == 'system' -%}
{{- render_role_message(messages[0]) -}}
{%- set messages = messages[1:] -%}
{%- endif -%}
{# ----- RENDER TOOLS ----- #}
{%- if tools -%}
{%- set tools_content = (
render_tool_namespace('functions', tools)
+ "\n\n"
) -%}
{{- render_role_message({'role': 'function descriptions', 'content': tools_content}) -}}
{%- endif -%}
{# ----- MAIN MESSAGE LOOP ----- #}
{%- for message in messages -%}
{# ----- TOOL MESSAGE -------#}
{%- if message['role'] == 'tool' -%}
{{- render_role_message(message, role='function result') -}}
{# ----- ASSISTANT MESSAGE ----- #}
{%- elif message['role'] == 'assistant' -%}
{# ----- FUNCTION CALL PART CHECKING: SINGLE CALL SETUP ----- #}
{%- if message.tool_calls is defined and message.tool_calls -%}
{%- set function_call = message.tool_calls[0] -%}
{%- else -%}
{%- set function_call = None -%}
{%- endif -%}
{# ----- MAIN ASSISTANT RENDERING ----- #}
{{- render_role_message({'role': 'assistant', 'content': message.content}) -}}
{%- if function_call -%}
{{- render_function_call({'role': 'function call', 'content': function_call}) -}}
{%- endif -%}
{# ----- OTHER MESSAGES ----- #}
{%- else -%}
{{- render_role_message(message) -}}
{%- endif -%}
{# ----- ADDING GENERATION PROMPT ----- #}
{%- if loop.last and add_generation_prompt and message['role'] != 'assistant' -%}
{{- 'assistant' + add_tokens.role_sep -}}
{%- endif -%}
{%- endfor -%}

53
config.json Normal file
View File

@@ -0,0 +1,53 @@
{
"vocab_size": 128256,
"max_position_embeddings": 262144,
"hidden_size": 1536,
"intermediate_size": 8960,
"moe_intermediate_size": 1280,
"num_hidden_layers": 26,
"num_nextn_predict_layers": 1,
"num_attention_heads": 32,
"n_shared_experts": 1,
"n_routed_experts": 64,
"ep_size": 1,
"routed_scaling_factor": 1.0,
"kv_lora_rank": 512,
"q_lora_rank": null,
"qk_rope_head_dim": 64,
"v_head_dim": 192,
"qk_nope_head_dim": 128,
"topk_method": "noaux_tc",
"n_group": 1,
"topk_group": 1,
"num_experts_per_tok": 4,
"moe_layer_freq": 1,
"first_k_dense_replace": 1,
"norm_topk_prob": true,
"scoring_func": "sigmoid",
"num_key_value_heads": 32,
"hidden_act": "silu",
"initializer_range": 0.006,
"rms_norm_eps": 1e-06,
"use_cache": true,
"rope_theta": 100000,
"rope_scaling": {
"beta_fast": 32,
"beta_slow": 1,
"factor": 64.0,
"mscale": 1.0,
"mscale_all_dim": 1.0,
"original_max_position_embeddings": 4096,
"type": "yarn"
},
"attention_bias": false,
"attention_dropout": 0.0,
"tie_word_embeddings": false,
"architectures": [
"DeepseekV3ForCausalLM"
],
"bos_token_id": 1,
"eos_token_id": 2,
"transformers_version": "4.57.1",
"model_type": "deepseek_v3",
"dtype": "bfloat16"
}

9
generation_config.json Normal file
View File

@@ -0,0 +1,9 @@
{
"temperature": 0.7,
"top_p": 0.3,
"repetition_penalty": 1.1,
"do_sample": true,
"bos_token_id": 1,
"eos_token_id": 2,
"pad_token_id": 2
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:da25ceee4caf0713346bd4c63b726b1550c41d130b796e9330eb4427917bec98
size 4986065392

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f005b3cd335d1b77b8275abd171da1c9bb951ccf707b4145e1be1462074f228a
size 37440

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:56617279611142173dac0e467a6183f7be09440ac1b2b30df9fa3e127b2e83cd
size 37456

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0599c2553a9c72a1b59ea784a42114d0481587021756a64cdf7fd9f7e447e5ea
size 37456

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d36588fce12b9a3d75c00e59a58ec0189d23e10e33104b50223bfacdec288e92
size 37456

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7ef8cd08aaacca0e8ec8acacb9cfc929dcfe88090902f2251160a22729e42c80
size 14984

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:917df3f27b16cebbb3ef32cf325898c03935124d60d5f5fb240eb5328c6f6d11
size 4084983648

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8dabf07c95d3da8b4077cfd73b07b2705a17ce920fc674c41e931f2579af169f
size 4084984456

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f377b6d944fb168966ccac4d2941417e683edca991db40fcdfc4831d8222390a
size 4084984656

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:039ca2878f2074f27a4bcfd121581f02ab7e36f54c927d5a0ca2b1f8da221f66
size 4084984656

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fa3c7d6e8246e60508f713ce6e0e09f206ee9726cd8e9a4aa8362afac685b91a
size 1633993536

5330
model.safetensors.index.json Normal file

File diff suppressed because it is too large Load Diff

16
special_tokens_map.json Normal file
View File

@@ -0,0 +1,16 @@
{
"bos_token": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "</s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.json Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3fdb3c045850a565109244ef3b89475cc2582769417647a41c46da14a3782aa5
size 10680605

123
tokenizer_config.json Normal file
View File

@@ -0,0 +1,123 @@
{
"added_tokens_decoder": {
"1": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "</s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128000": {
"content": "<|role_sep|>\n",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128001": {
"content": "<|message_sep|>\n\n",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128002": {
"content": "<|file|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128003": {
"content": "<|/file|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128004": {
"content": "[image_token]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128005": {
"content": "[video_image_token]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128006": {
"content": "[audio_token]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128007": {
"content": "[video_audio_token]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128008": {
"content": "<point>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128009": {
"content": "</point>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128010": {
"content": "<bbox>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"128011": {
"content": "</bbox>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"bos_token": "<s>",
"clean_up_tokenization_spaces": true,
"eos_token": "</s>",
"extra_special_tokens": {},
"model_max_length": 1000000000000000019884624838656,
"tokenizer_class": "PreTrainedTokenizer",
"unk_token": null
}