Add files using upload-large-folder tool
Browse files- config.json +10 -0
- model-00001-of-00002.safetensors +3 -0
- model-00002-of-00002.safetensors +3 -0
- model.safetensors.index.json +0 -0
- tokenizer_config.json +2 -1
config.json
CHANGED
@@ -21,6 +21,16 @@
|
|
21 |
"pad_token_id": 3,
|
22 |
"post_norm": false,
|
23 |
"qk_norm": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
"rms_norm_eps": 1e-05,
|
25 |
"rope_scaling": {
|
26 |
"factor": 8.0,
|
|
|
21 |
"pad_token_id": 3,
|
22 |
"post_norm": false,
|
23 |
"qk_norm": true,
|
24 |
+
"quantization": {
|
25 |
+
"group_size": 64,
|
26 |
+
"bits": 6,
|
27 |
+
"mode": "affine"
|
28 |
+
},
|
29 |
+
"quantization_config": {
|
30 |
+
"group_size": 64,
|
31 |
+
"bits": 6,
|
32 |
+
"mode": "affine"
|
33 |
+
},
|
34 |
"rms_norm_eps": 1e-05,
|
35 |
"rope_scaling": {
|
36 |
"factor": 8.0,
|
model-00001-of-00002.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:288c348f8946226718c3b702c9ebbcce99f36ae6f832cba986a53eb2104b8d73
|
3 |
+
size 5327041899
|
model-00002-of-00002.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd9d98c626866c7ac84fb49d9364e9358291d162f0b77173b15f5e844b17877c
|
3 |
+
size 1216715461
|
model.safetensors.index.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
CHANGED
@@ -8005,6 +8005,7 @@
|
|
8005 |
}
|
8006 |
},
|
8007 |
"bos_token": "<s>",
|
|
|
8008 |
"clean_up_tokenization_spaces": false,
|
8009 |
"eos_token": "<|assistant_end|>",
|
8010 |
"extra_special_tokens": {},
|
@@ -8015,6 +8016,6 @@
|
|
8015 |
"model_max_length": 1000000000000000019884624838656,
|
8016 |
"pad_token": "<pad>",
|
8017 |
"padding_side": "left",
|
8018 |
-
"tokenizer_class": "
|
8019 |
"unk_token": "<unk>"
|
8020 |
}
|
|
|
8005 |
}
|
8006 |
},
|
8007 |
"bos_token": "<s>",
|
8008 |
+
"chat_template": "{%- macro render_typescript_type(param_spec, required_params, is_nullable=false) -%}\n {%- if param_spec.type == \"array\" -%}\n {%- if param_spec['items'] -%}\n {%- if param_spec['items']['type'] == \"string\" -%}\n {{- \"string[]\" }}\n {%- elif param_spec['items']['type'] == \"number\" -%}\n {{- \"number[]\" }}\n {%- elif param_spec['items']['type'] == \"integer\" -%}\n {{- \"number[]\" }}\n {%- elif param_spec['items']['type'] == \"boolean\" -%}\n {{- \"boolean[]\" }}\n {%- else -%}\n {%- set inner_type = render_typescript_type(param_spec['items'], required_params) -%}\n {%- if inner_type == \"object | object\" or inner_type|length > 50 -%}\n {{- \"any[]\" }}\n {%- else -%}\n {{- inner_type + \"[]\" }}\n {%- endif -%}\n {%- endif -%}\n {%- if param_spec.nullable -%}\n {{- \" | null\" }}\n {%- endif -%}\n {%- else -%}\n {{- \"any[]\" }}\n {%- if param_spec.nullable -%}\n {{- \" | null\" }}\n {%- endif -%}\n {%- endif -%}\n {%- elif param_spec.type is defined and param_spec.type is iterable and param_spec.type is not string and param_spec.type is not mapping and param_spec.type[0] is defined -%}\n {#- Handle array of types like [\"object\", \"object\"] from Union[dict, list] #}\n {%- if param_spec.type | length > 1 -%}\n {{- param_spec.type | join(\" | \") }}\n {%- else -%}\n {{- param_spec.type[0] }}\n {%- endif -%}\n {%- elif param_spec.oneOf -%}\n {#- Handle oneOf schemas - check for complex unions and fallback to any #}\n {%- set has_object_variants = false -%}\n {%- for variant in param_spec.oneOf -%}\n {%- if variant.type == \"object\" -%}\n {%- set has_object_variants = true -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if has_object_variants and param_spec.oneOf|length > 1 -%}\n {{- \"any\" }}\n {%- else -%}\n {%- for variant in param_spec.oneOf -%}\n {{- render_typescript_type(variant, required_params) -}}\n {%- if variant.description %}\n {{- \"// \" + variant.description }}\n {%- endif -%}\n {%- if variant.default is defined %}\n {{ \"// default: \" + variant.default|tojson }}\n {%- endif -%}\n {%- if not loop.last %}\n {{- \" | \" }}\n {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n {%- elif param_spec.type == \"string\" -%}\n {%- if param_spec.enum -%}\n {{- '\"' + param_spec.enum|join('\" | \"') + '\"' -}}\n {%- else -%}\n {{- \"string\" }}\n {%- if param_spec.nullable %}\n {{- \" | null\" }}\n {%- endif -%}\n {%- endif -%}\n {%- elif param_spec.type == \"number\" -%}\n {{- \"number\" }}\n {%- elif param_spec.type == \"integer\" -%}\n {{- \"number\" }}\n {%- elif param_spec.type == \"boolean\" -%}\n {{- \"boolean\" }}\n {%- elif param_spec.type == \"object\" -%}\n {%- if param_spec.properties -%}\n {{- \"{\\n\" }}\n {%- for prop_name, prop_spec in param_spec.properties.items() -%}\n {{- prop_name -}}\n {%- if prop_name not in (param_spec.required or []) -%}\n {{- \"?\" }}\n {%- endif -%}\n {{- \": \" }}\n {{ render_typescript_type(prop_spec, param_spec.required or []) }}\n {%- if not loop.last -%}\n {{-\", \" }}\n {%- endif -%}\n {%- endfor -%}\n {{- \"}\" }}\n {%- else -%}\n {{- \"object\" }}\n {%- endif -%}\n {%- else -%}\n {{- \"any\" }}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- macro render_tools(tools) -%}\n {%- for tool in tools %}\n {{- \"// \" + tool.description + \"\\n\" }}\n {{- \"type \"+ tool.name + \" = \" }}\n {%- if tool.parameters and tool.parameters.properties %}\n {{- \"(_: {\\n\" }}\n {%- for param_name, param_spec in tool.parameters.properties.items() %}\n {%- if param_spec.description %}\n {{- \"// \" + param_spec.description + \"\\n\" }}\n {%- endif %}\n {{- param_name }}\n {%- if param_name not in (tool.parameters.required or []) -%}\n {{- \"?\" }}\n {%- endif -%}\n {{- \": \" }}\n {{- render_typescript_type(param_spec, tool.parameters.required or []) }}\n {%- if param_spec.default is defined -%}\n {%- if param_spec.enum %}\n {{- \", // default: \" + param_spec.default }}\n {%- elif param_spec.oneOf %}\n {{- \"// default: \" + param_spec.default }}\n {%- else %}\n {{- \", // default: \" + param_spec.default|tojson }}\n {%- endif -%}\n {%- endif -%}\n {%- if not loop.last %}\n {{- \",\\n\" }}\n {%- else %}\n {{- \"\\n\" }}\n {%- endif -%}\n {%- endfor %}\n {{- \"}) => any;\" }}\n {%- else -%}\n {{- \"() => any;\" }}\n {%- endif -%}\n {%- if not loop.last -%}\n {{- \"\\n\" }}\n {%- endif -%}\n {%- endfor %}\n{%- endmacro -%}\n\n{{ bos_token }}\n\n{%- set system_token = '<|system_start|>' -%}\n{%- set end_system_token = '<|system_end|>' -%}\n{%- set developer_token = '<|developer_start|>' -%}\n{%- set end_developer_token = '<|developer_end|>' -%}\n{%- set user_token = '<|user_start|>' -%}\n{%- set end_user_token = '<|user_end|>' -%}\n{%- set assistant_token = '<|assistant_start|>' -%}\n{%- set end_assistant_token = '<|assistant_end|>' -%}\n{%- set inner_token = '<|inner_prefix|>' -%}\n{%- set outer_token = '<|inner_suffix|>' -%}\n{%- set tool_calls_token = '<|tools_prefix|>' -%}\n{%- set end_tool_calls_token = '<|tools_suffix|>' -%}\n\n{%- set ns = namespace(in_assistant=false, in_tool=false, in_inner=false, assistant_format=none) -%}\n\n{%- if messages and messages[0].role == 'system' -%}\n {%- if \"content\" in messages[0] -%}\n {%- if messages[0].content is string -%}\n {{ system_token + messages[0].content + end_system_token }}\n {%- elif messages[0].content is mapping and \"text\" in messages[0].content -%}\n {{ system_token + messages[0].content.text + end_system_token }}\n {%- else -%}\n {{- raise_exception(\"Invalid system message\") -}}\n {%- endif -%}\n {%- else -%}\n {{- raise_exception(\"Invalid system message\") -}}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {{ system_token + 'You are Apertus, a helpful assistant created by the SwissAI initiative.\\nKnowledge cutoff: 2024-04\\nCurrent date: ' + strftime_now('%Y-%m-%d') + end_system_token }}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n\n{{ developer_token + 'Deliberation: ' }}\n{%- if enable_thinking is defined and enable_thinking -%}\n {{ 'enabled\\n' }}\n{%- else -%}\n {{ 'disabled\\n' }}\n{%- endif -%}\n{%- if tools is defined and tools -%}\n {{ 'Tool Capabilities:\\n' + render_tools(tools) }}\n{%- else -%}\n {{ 'Tool Capabilities: disabled' }}\n{%- endif -%}\n{{ end_developer_token }}\n\n{%- for message in loop_messages -%}\n {%- if message.role == 'user' -%}\n {%- set ns.in_inner = false -%}\n {%- if ns.in_tool -%}\n {{ ']' }}\n {%- set ns.in_tool = false -%}\n {%- endif -%}\n {%- if ns.in_assistant -%}\n {{ end_assistant_token }}\n {%- set ns.in_assistant = false -%}\n {%- endif -%}\n {%- if \"content\" in message -%}\n {{ user_token }}\n {%- if message.content is string -%}\n {{ message.content }}\n {%- elif message.content is mapping and \"parts\" in message.content -%}\n {%- set parts = message.content.parts -%}\n {%- for part in parts -%}\n {%- if part.type == \"text\" -%}\n {{ part.text }}\n {%- else -%}\n {{- raise_exception(\"Invalid user part: \" + part.type) -}}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{- raise_exception(\"Invalid user message: \" + message.role) -}}\n {%- endif -%}\n {{ end_user_token }}\n {%- endif -%}\n {%- elif message.role == 'assistant' -%}\n {%- if not ns.in_assistant -%}\n {{ assistant_token }}\n {%- set ns.in_assistant = true -%}\n {%- endif -%}\n {%- if \"content\" in message -%}\n {%- if message.content is string and (ns.assistant_format is none or ns.assistant_format == \"string\") -%}\n {%- if ns.in_tool -%}\n {{ ']' }}\n {%- set ns.in_tool = false -%}\n {%- endif -%}\n {%- set ns.assistant_format = \"string\" -%}\n {{ message.content }}\n {%- elif message.content is mapping and \"blocks\" in message.content and (ns.assistant_format is none or ns.assistant_format == \"mapping\") -%}\n {%- set ns.assistant_format = \"mapping\" -%}\n {%- set blocks = message.content.blocks -%}\n {%- for block in blocks -%}\n {%- if block.type == 'thoughts' -%}\n {%- if ns.in_tool -%}\n {{ ']' }}\n {%- set ns.in_tool = false -%}\n {%- endif -%}\n {%- if not ns.in_inner -%}\n {%- set ns.in_inner = true -%}\n {{ inner_token }}\n {%- endif -%}\n {{ block.text }}\n {%- elif block.type == 'tool_calls' -%}\n {%- if ns.in_tool -%}\n {{ ']' }}\n {%- set ns.in_tool = false -%}\n {%- endif -%}\n {%- if ns.in_inner and not loop.first and block.calls|length == 1 and block.calls[0].name == 'display_answers' -%}\n {%- set ns.in_inner = false -%}\n {{ outer_token }}\n {%- endif -%}\n {{ tool_calls_token + '[' }}\n {%- for tool_call in block.calls -%}\n {{- '{\"' + tool_call.name + '\": ' + tool_call.arguments + '}' }}\n {%- if not loop.last -%}\n {{- \", \" }}\n {%- endif -%}\n {%- endfor -%}\n {{ ']' + end_tool_calls_token }}\n {%- elif block.type == 'tool_outputs' -%}\n {%- if ns.in_tool -%}\n {{- raise_exception(\"Cannot have both tool outputs as separate messages and tool outputs as blocks\") -}}\n {%- endif -%}\n {{ '[' }}\n {%- for tool_output in block.outputs -%}\n {{- tool_output.output }}\n {%- if not loop.last -%}\n {{- \", \" }}\n {%- endif -%}\n {%- endfor -%}\n {{- ']' }}\n {%- elif block.type == 'response' -%}\n {%- if ns.in_tool -%}\n {{ ']' }}\n {%- set ns.in_tool = false -%}\n {%- endif -%}\n {%- if (not loop.first and ns.in_inner) or (ns.in_assistant and ns.in_inner) -%}\n {%- set ns.in_inner = false -%}\n {{ outer_token }}\n {%- endif -%}\n {{ block.text }}\n {%- else -%}\n {{- raise_exception(\"Invalid assistant block type: \" + block.type) -}}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{- raise_exception(\"Invalid assistant content\") -}}\n {%- endif -%}\n {%- else -%}\n {{- raise_exception(\"Invalid assistant message\") -}}\n {%- endif -%}\n {%- if \"tool_calls\" in message and message.tool_calls -%}\n {{ tool_calls_token + '[' }}\n {%- for tool_call in message.tool_calls -%}\n {%- if tool_call.type == 'function' -%}\n {%- set function = tool_call.function -%}\n {{- '{\"' + function.name + '\": ' + function.arguments + '}' }}\n {%- if not loop.last -%}\n {{- \", \" }}\n {%- endif -%}\n {%- else -%}\n {{- raise_exception(\"Invalid tool call type: \" + tool_call.type) -}}\n {%- endif -%}\n {%- endfor -%}\n {{ ']' + end_tool_calls_token }}\n {%- endif -%}\n {%- elif message.role == 'tool' -%}\n {%- if not ns.in_assistant -%}\n {{- raise_exception(\"Tool message outside of assistant\") -}}\n {%- endif -%}\n {%- if not ns.in_tool -%}\n {{ '[' }}\n {%- set ns.in_tool = true -%}\n {%- else -%}\n {{ \", \"}}\n {%- endif -%}\n {{ message.content }}\n {%- else -%}\n {{- raise_exception(\"Invalid message role\") -}}\n {%- endif -%}\n{%- endfor -%}\n{%- if ns.in_tool -%}\n {{ ']' }}\n{%- endif -%}\n{%- if add_generation_prompt -%}\n {{ assistant_token }}\n{%- endif -%}\n",
|
8009 |
"clean_up_tokenization_spaces": false,
|
8010 |
"eos_token": "<|assistant_end|>",
|
8011 |
"extra_special_tokens": {},
|
|
|
8016 |
"model_max_length": 1000000000000000019884624838656,
|
8017 |
"pad_token": "<pad>",
|
8018 |
"padding_side": "left",
|
8019 |
+
"tokenizer_class": "PreTrainedTokenizer",
|
8020 |
"unk_token": "<unk>"
|
8021 |
}
|