AngelSlim/Hy4-preview-GGUF
zetlyn/models-hf model hf AngelSlim/Hy4-preview-GGUF known 2026-08-28
https://huggingface.co/AngelSlim/Hy4-preview-GGUF
Properties
| author | AngelSlimreceipt
What the source handed over{
"_asked": "AngelSlim/Hy4-preview-GGUF",
"_id": "6a919dd7be8829f5d075d08e",
"author": "AngelSlim",
"config": {},
"createdAt": "2026-08-28T14:40:23.000Z",
"disabled": false,
"downloads": 288825,
"gated": false,
"gguf": {
"architecture": "hyv4",
"bos_token": "<|hy_start:6124c78e|>",
"chat_template": "{#- ----------‑‑‑ special token variables ‑‑‑---------- -#}\n{%- set HYTK = ':6124c78e' %}\n{%- set hy_start_token = '<|hy_start{}|>'.format(HYTK) %}\n{%- set hy_middle_token = '<|hy_middle{}|>'.format(HYTK) %}\n{%- set hy_end_token = '<|hy_end{}|>'.format(HYTK) %}\n{%- set image_start_token = '<|hy_image▁start{}|>'.format(HYTK) %}\n{%- set image_pad_token = '<|hy_image▁pad{}|>'.format(HYTK) %}\n{%- set image_end_token = '<|hy_image▁end{}|>'.format(HYTK) %}\n{%- set video_start_token = '<|hy_video▁start{}|>'.format(HYTK) %}\n{%- set video_pad_token = '<|hy_video▁pad{}|>'.format(HYTK) %}\n{%- set video_end_token = '<|hy_video▁end{}|>'.format(HYTK) %}\n{%- set think_begin_token = '<think{}>'.format(HYTK) %}\n{%- set think_end_token = '</think{}>'.format(HYTK) %}\n{%- set toolcalls_begin_token = '<tool_calls{}>'.format(HYTK) %}\n{%- set toolcalls_end_token = '</tool_calls{}>'.format(HYTK) %}\n{%- set toolcall_begin_token = '<tool_call{}>'.format(HYTK) %}\n{%- set toolcall_end_token = '</tool_call{}>'.format(HYTK) %}\n{%- set argkey_begin_token = '<arg_key{}>'.format(HYTK) %}\n{%- set argkey_end_token = '</arg_key{}>'.format(HYTK) %}\n{%- set argvalue_begin_token = '<arg_value{}>'.format(HYTK) %}\n{%- set argvalue_end_token = '</arg_value{}>'.format(HYTK) %}\n{%- set toolresponse_begin_token = '<tool_response{}>'.format(HYTK) %}\n{%- set toolresponse_end_token = '</tool_response{}>'.format(HYTK) %}\n{%- set reasoning_mode_token = '<|reasoning_mode{}|>'.format(HYTK) %}\n\n{#- ----------‑‑‑ hyperparameters variables ‑‑‑---------- -#}\n{%- if not add_generation_prompt is defined %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- if not preserved_thinking is defined %}\n {%- if not tools %}\n {%- set preserved_thinking = false %}\n {%- else %}\n {%- set preserved_thinking = true %}\n {%- endif %}\n{%- endif %}\n\n{%- if not reasoning_effort is defined %}\n {%- set reasoning_effort = 'high' %}\n{%- elif reasoning_effort not in ['high', 'low', 'no_think'] %}\n {%- if reasoning_effort is none %}\n {{- raise_exception('reasoning_effort error : None, should be no_think/low/high') }}\n {%- else %}\n {{- raise_exception('reasoning_effort error : ' + reasoning_effort + ', should be no_think/low/high') }}\n {%- endif %}\n{%- endif %}\n\n{%- if fallback_strategy is defined and fallback_strategy == 'reasoning_toolcall_retry' %}\n {%- set reasoning_effort = 'high' %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- if not raw_last_assistant is defined %}\n {%- set raw_last_assistant = false %}\n{%- endif %}\n{%- if not add_vision_id is defined %}\n {%- set add_vision_id = false %}\n{%- endif %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n\n{%- macro tool_to_json(tool) -%}\n {%- set ns_tool = namespace(first=true) -%}\n {{- '{' -}}\n {%- for k, v in tool.items() -%}\n {%- if k != 'defer_loading' and k != 'strict' -%}\n {%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}\n {%- set ns_tool.first = false -%}\n {{- '\"' ~ k ~ '\": ' ~ (v | tojson(ensure_ascii=False)) -}}\n {%- endif -%}\n {%- endfor -%}\n {{- '}' -}}\n{%- endmacro -%}\n\n{%- macro render_content(content, do_vision_count=true, is_system_content=false) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text -}}\n {%- elif item is mapping and ('image' in item or 'image_url' in item or item.type in ['image', 'image_url']) -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain images.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set image_count.value = image_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Picture ' ~ image_count.value ~ ': ' -}}\n {%- endif -%}\n {{- image_start_token ~ image_pad_token ~ image_end_token -}}\n {%- elif item is mapping and ('video' in item or 'video_url' in item or item.type in ['video', 'video_url']) -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain videos.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set video_count.value = video_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Video ' ~ video_count.value ~ ': ' -}}\n {%- endif -%}\n {{- video_start_token ~ video_pad_token ~ video_end_token -}}\n {%- elif item is string -%}\n {{- item -}}\n {%- else -%}\n {{- item | string -}}\n {%- endif -%}\n {%- endfor -%}\n {%- elif content is none -%}\n {{- '' -}}\n {%- else -%}\n {{- content | string -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- macro render_tools_prompt() -%}\n {{- '# Tools\\n\\nYou may call one or more functions to assist with the user query.' -}}\n {{- '\\n\\nYou are provided with function signatures within <tools></tools> XML tags:' -}}\n {{- '\\n<tools>\\n' -}}\n {%- set tool_ns = namespace(first=true) -%}\n {%- for tool in tools -%}\n {%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- if t.defer_loading is not defined or not t.defer_loading -%}\n {%- if not tool_ns.first -%}{{- '\\n' -}}{%- endif -%}\n {%- set tool_ns.first = false -%}\n {{- tool_to_json(t) -}}\n {%- endif -%}\n {%- endfor -%}\n {{- '\\n</tools>\\n\\n' -}}\n {{- 'For function call returns, you should first print ' ~ toolcalls_begin_token -}}\n {{- '\\nFor each function call, you should return object like:\\n' -}}\n {{- toolcall_begin_token ~ '{function-name}' -}}\n {{- argkey_begin_token ~ '{arg-key-1}' ~ argkey_end_token -}}\n {{- argvalue_begin_token ~ '{arg-value-1}' ~ argvalue_end_token -}}\n {{- argkey_begin_token ~ '{arg-key-2}' ~ argkey_end_token -}}\n {{- argvalue_begin_token ~ '{arg-value-2}' ~ argvalue_end_token -}}\n {{- '...' -}}\n {{- toolcall_end_token -}}\n {{- '\\nAt the end of function call returns, you should print ' ~ toolcalls_end_token -}}\n{%- endmacro -%}\n\n{%- macro render_tool_response(message) -%}\n {%- set content = message['content'] -%}\n {%- if content is string -%}\n {{- toolresponse_begin_token ~ content ~ toolresponse_end_token -}}\n {%- elif content is iterable and content is not mapping and content and content[0] is mapping and content[0].type == 'tool_reference' -%}\n {{- toolresponse_begin_token -}}\n {{- '<tools>\\n' -}}\n {%- for tr in content -%}\n {%- for tool in tools -%}\n {%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- if t.name == tr.name -%}\n {{- tool_to_json(t) ~ '\\n' -}}\n {%- endif -%}\n {%- endfor -%}\n {%- endfor -%}\n {{- '</tools>' -}}\n {{- toolresponse_end_token -}}\n {%- elif content is iterable and content is not mapping and content and content[0] is mapping and content[0].output is defined -%}\n {%- for tr in content -%}\n {{- toolresponse_begin_token ~ tr.output ~ toolresponse_end_token -}}\n {%- endfor -%}\n {%- else -%}\n {{- toolresponse_begin_token ~ render_content(content) ~ toolresponse_end_token -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{#- consecutive tool messages are clustered into a single tool message whose content is the list of the original tool messages; the result is written to merged_ns.messages (a macro cannot return a list) -#}\n{%- set merged_ns = namespace(messages=[]) %}\n{%- macro merge_tool_responses(messages) -%}\n {%- set merge_ns = namespace(result=[], cluster=[]) -%}\n {%- for message in messages -%}\n {%- if message['role'] == 'tool' -%}\n {%- set merge_ns.cluster = merge_ns.cluster + [message] -%}\n {%- else -%}\n {%- if merge_ns.cluster -%}\n {%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}\n {%- set merge_ns.cluster = [] -%}\n {%- endif -%}\n {%- set merge_ns.result = merge_ns.result + [message] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if merge_ns.cluster -%}\n {%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}\n {%- endif -%}\n {%- set merged_ns.messages = merge_ns.result -%}\n{%- endmacro -%}\n\n{#- render one tool cluster, reordered to follow the tool_call order of the preceding assistant turn; any missing / ambiguous id falls back to the original tool message order for the whole cluster -#}\n{%- macro render_tool_responses(tool_messages, tool_call_ids) -%}\n {%- set order_ns = namespace(ordered=[], matched=true) -%}\n {%- if tool_call_ids and tool_call_ids | length == tool_messages | length -%}\n {%- for tool_call_id in tool_call_ids -%}\n {%- set hit_ns = namespace(count=0, message=none) -%}\n {%- for tool_message in tool_messages -%}\n {%- set message_id = tool_message['tool_call_id'] if tool_message['tool_call_id'] is defined else tool_message['id'] -%}\n {%- if message_id is defined and message_id == tool_call_id -%}\n {%- set hit_ns.count = hit_ns.count + 1 -%}\n {%- set hit_ns.message = tool_message -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if hit_ns.count == 1 -%}\n {%- set order_ns.ordered = order_ns.ordered + [hit_ns.message] -%}\n {%- else -%}\n {%- set order_ns.matched = false -%}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {%- set order_ns.matched = false -%}\n {%- endif -%}\n {%- for tool_message in (order_ns.ordered if order_ns.matched else tool_messages) -%}\n {{- render_tool_response(tool_message) -}}\n {%- endfor -%}\n{%- endmacro -%}\n\n{%- set _ = merge_tool_responses(messages) %}\n{%- set normed_messages = merged_ns.messages %}\n\n{%- set ns = namespace(last_user_index=-1, has_leading_system=false) %}\n{%- if normed_messages and normed_messages[0].role == 'system' %}\n {%- set ns.has_leading_system = true %}\n{%- endif %}\n{%- for message in normed_messages %}\n {%- if message['role'] == 'user' %}\n {%- set ns.last_user_index = loop.index0 %}\n {%- endif %}\n{%- endfor %}\n\n{#- no leading system: synthesize one for tools and/or reasoning_mode -#}\n{%- if not ns.has_leading_system %}\n {{- hy_start_token ~ 'system' ~ hy_middle_token -}}\n {%- if tools %}\n {{- render_tools_prompt() -}}\n {%- endif %}\n {{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}\n {{- hy_end_token -}}\n{%- endif %}\n\n{%- set last_ns = namespace(last_is_assistant=false) %}\n{%- set prev_ns = namespace(tool_call_ids=[]) %}\n{%- for message in normed_messages %}\n {%- if message['role'] == 'system' %}\n {{- hy_start_token ~ 'system' ~ hy_middle_token -}}\n {#- tools / reasoning_mode only attach to the leading system (messages[0]) -#}\n {%- if loop.first %}\n {%- if tools %}\n {{- render_tools_prompt() -}}\n {%- endif %}\n {%- set content = render_content(message['content']) -%}\n {%- if tools and content -%}\n {{- '\\n\\n' -}}\n {%- endif -%}\n {{- content -}}\n {{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}\n {%- else %}\n {{- render_content(message['content']) -}}\n {%- endif %}\n {{- hy_end_token -}}\n {%- elif message['role'] == 'user' %}\n {{- hy_start_token ~ 'user' ~ hy_middle_token -}}\n {{- render_content(message['content']) -}}\n {{- hy_end_token -}}\n {%- elif message['role'] == 'assistant' %}\n {%- set content_body = render_content(message['content']) -%}\n {#- 'reasoning' takes precedence, fall back to 'reasoning_content' when it is empty -#}\n {%- set reasoning_text = '' %}\n {%- if message['reasoning'] is defined and message['reasoning'] is string and message['reasoning'] %}\n {%- set reasoning_text = message['reasoning'] %}\n {%- elif message['reasoning_content'] is defined and message['reasoning_content'] is string and message['reasoning_content'] %}\n {%- set reasoning_text = message['reasoning_content'] %}\n {%- endif %}\n {#- no_think overrides preserved_thinking: history is always emitted with empty think tags -#}\n {%- if reasoning_effort != 'no_think' and (preserved_thinking or loop.index0 > ns.last_user_index) and reasoning_text %}\n {%- set content = think_begin_token ~ reasoning_text ~ think_end_token ~ content_body %}\n {%- else %}\n {%- set content = think_begin_token ~ think_end_token ~ content_body %}\n {%- endif %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token -}}\n {%- if message['tool_calls'] is defined and message['tool_calls'] %}\n {#- remember the tool_call ids of this turn to order the following tool responses; an incomplete id set means \"do not reorder\" -#}\n {%- set ids_ns = namespace(ids=[], complete=true) %}\n {%- for tool in message['tool_calls'] %}\n {%- set tool_call_id = tool['id'] if tool['id'] is defined and tool['id'] else tool['tool_call_id'] %}\n {%- if tool_call_id is defined and tool_call_id %}\n {%- set ids_ns.ids = ids_ns.ids + [tool_call_id] %}\n {%- else %}\n {%- set ids_ns.complete = false %}\n {%- endif %}\n {%- endfor %}\n {%- set prev_ns.tool_call_ids = ids_ns.ids if ids_ns.complete else [] %}\n {{- content -}}\n {{- toolcalls_begin_token -}}\n {%- for tool in message['tool_calls'] -%}\n {%- set func = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- set arguments = func['arguments'] -%}\n {{- toolcall_begin_token ~ func['name'] -}}\n {%- for key, value in arguments.items() -%}\n {{- argkey_begin_token ~ key ~ argkey_end_token -}}\n {%- if value is not string -%}\n {%- set value = value | tojson(ensure_ascii=False) -%}\n {%- endif -%}\n {{- argvalue_begin_token ~ value ~ argvalue_end_token -}}\n {%- endfor -%}\n {{- toolcall_end_token -}}\n {%- endfor -%}\n {{- toolcalls_end_token -}}\n {%- else %}\n {%- if loop.last and raw_last_assistant %}\n {{- content_body -}}\n {%- else %}\n {{- content -}}\n {%- endif %}\n {%- endif %}\n {#- continuation / prefill: last assistant is still open, do not close with hy_end -#}\n {%- if not (loop.last and raw_last_assistant) %}\n {{- hy_end_token -}}\n {%- endif %}\n {%- elif message['role'] == 'tool' %}\n {{- hy_start_token ~ 'tool' ~ hy_middle_token -}}\n {{- render_tool_responses(message['content'], prev_ns.tool_call_ids) -}}\n {{- hy_end_token -}}\n {%- else %}\n {{- hy_start_token ~ message['role'] ~ hy_middle_token -}}\n {{- render_content(message['content']) -}}\n {{- hy_end_token -}}\n {%- endif %}\n {%- if message['role'] != 'assistant' or not (message['tool_calls'] is defined and message['tool_calls']) %}\n {%- set prev_ns.tool_call_ids = [] %}\n {%- endif %}\n {%- if loop.last and message['role'] == 'assistant' %}\n {%- set last_ns.last_is_assistant = true %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {%- if not last_ns.last_is_assistant %}\n {%- if reasoning_effort == 'no_think' %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token ~ think_end_token -}}\n {%- else %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token -}}\n {%- endif %}\n {%- endif %}\n{%- endif %}\n",
"context_length": 1048576,
"eos_token": "<|hy_end:6124c78e|>",
"quantize_imatrix_file": "/apdcephfs_jn5/share_300532381/harthuang/candidate_2/imatrix/merged/imatrix.attn_gate_remapped.gguf",
"total": 769907408797,
"totalFileSize": 467292398016
},
"id": "AngelSlim/Hy4-preview-GGUF",
"lastModified": "2026-09-01T05:11:08.000Z",
"likes": 100,
"modelId": "AngelSlim/Hy4-preview-GGUF",
"private": false,
"sha": "779242edccdedc2109a0b36b164263a88f015bfa",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "Hy4-preview-Q4_K_M.gguf"
},
{
"rfilename": "Hy4-preview-STQ1_0.gguf"
},
{
"rfilename": "Hy4-preview-UD-IQ1_M.gguf"
},
{
"rfilename": "README.md"
},
{
"rfilename": "hy4-preview-patch/0001-hyv4-architecture.patch"
},
{
"rfilename": "hy4-preview-patch/0002-stq1_0-quant-and-cuda.patch"
},
{
"rfilename": "hy4-preview-patch/Hy4-preview-Q4_K_M.tensortypes"
},
{
"rfilename": "hy4-preview-patch/Hy4-preview-STQ1_0.tensortypes"
},
{
"rfilename": "prima-runtime/SHA256SUMS"
},
{
"rfilename": "prima-runtime/prima-server-preview-4090-rank1-linux-x86_64-cuda-runtime.tar.gz"
},
{
"rfilename": "prima-runtime/prima-server-preview-a4000-rank0-linux-x86_64-cuda-runtime.tar.gz"
}
],
"spaces": [
"tardellirs/model-pulse"
],
"tags": [
"gguf",
"endpoints_compatible",
"region:us",
"imatrix",
"conversational"
],
"usedStorage": 932151934379
} | ||||||
|---|---|---|---|---|---|---|---|
| downloads | 288825receipt
What the source handed over{
"_asked": "AngelSlim/Hy4-preview-GGUF",
"_id": "6a919dd7be8829f5d075d08e",
"author": "AngelSlim",
"config": {},
"createdAt": "2026-08-28T14:40:23.000Z",
"disabled": false,
"downloads": 288825,
"gated": false,
"gguf": {
"architecture": "hyv4",
"bos_token": "<|hy_start:6124c78e|>",
"chat_template": "{#- ----------‑‑‑ special token variables ‑‑‑---------- -#}\n{%- set HYTK = ':6124c78e' %}\n{%- set hy_start_token = '<|hy_start{}|>'.format(HYTK) %}\n{%- set hy_middle_token = '<|hy_middle{}|>'.format(HYTK) %}\n{%- set hy_end_token = '<|hy_end{}|>'.format(HYTK) %}\n{%- set image_start_token = '<|hy_image▁start{}|>'.format(HYTK) %}\n{%- set image_pad_token = '<|hy_image▁pad{}|>'.format(HYTK) %}\n{%- set image_end_token = '<|hy_image▁end{}|>'.format(HYTK) %}\n{%- set video_start_token = '<|hy_video▁start{}|>'.format(HYTK) %}\n{%- set video_pad_token = '<|hy_video▁pad{}|>'.format(HYTK) %}\n{%- set video_end_token = '<|hy_video▁end{}|>'.format(HYTK) %}\n{%- set think_begin_token = '<think{}>'.format(HYTK) %}\n{%- set think_end_token = '</think{}>'.format(HYTK) %}\n{%- set toolcalls_begin_token = '<tool_calls{}>'.format(HYTK) %}\n{%- set toolcalls_end_token = '</tool_calls{}>'.format(HYTK) %}\n{%- set toolcall_begin_token = '<tool_call{}>'.format(HYTK) %}\n{%- set toolcall_end_token = '</tool_call{}>'.format(HYTK) %}\n{%- set argkey_begin_token = '<arg_key{}>'.format(HYTK) %}\n{%- set argkey_end_token = '</arg_key{}>'.format(HYTK) %}\n{%- set argvalue_begin_token = '<arg_value{}>'.format(HYTK) %}\n{%- set argvalue_end_token = '</arg_value{}>'.format(HYTK) %}\n{%- set toolresponse_begin_token = '<tool_response{}>'.format(HYTK) %}\n{%- set toolresponse_end_token = '</tool_response{}>'.format(HYTK) %}\n{%- set reasoning_mode_token = '<|reasoning_mode{}|>'.format(HYTK) %}\n\n{#- ----------‑‑‑ hyperparameters variables ‑‑‑---------- -#}\n{%- if not add_generation_prompt is defined %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- if not preserved_thinking is defined %}\n {%- if not tools %}\n {%- set preserved_thinking = false %}\n {%- else %}\n {%- set preserved_thinking = true %}\n {%- endif %}\n{%- endif %}\n\n{%- if not reasoning_effort is defined %}\n {%- set reasoning_effort = 'high' %}\n{%- elif reasoning_effort not in ['high', 'low', 'no_think'] %}\n {%- if reasoning_effort is none %}\n {{- raise_exception('reasoning_effort error : None, should be no_think/low/high') }}\n {%- else %}\n {{- raise_exception('reasoning_effort error : ' + reasoning_effort + ', should be no_think/low/high') }}\n {%- endif %}\n{%- endif %}\n\n{%- if fallback_strategy is defined and fallback_strategy == 'reasoning_toolcall_retry' %}\n {%- set reasoning_effort = 'high' %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- if not raw_last_assistant is defined %}\n {%- set raw_last_assistant = false %}\n{%- endif %}\n{%- if not add_vision_id is defined %}\n {%- set add_vision_id = false %}\n{%- endif %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n\n{%- macro tool_to_json(tool) -%}\n {%- set ns_tool = namespace(first=true) -%}\n {{- '{' -}}\n {%- for k, v in tool.items() -%}\n {%- if k != 'defer_loading' and k != 'strict' -%}\n {%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}\n {%- set ns_tool.first = false -%}\n {{- '\"' ~ k ~ '\": ' ~ (v | tojson(ensure_ascii=False)) -}}\n {%- endif -%}\n {%- endfor -%}\n {{- '}' -}}\n{%- endmacro -%}\n\n{%- macro render_content(content, do_vision_count=true, is_system_content=false) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text -}}\n {%- elif item is mapping and ('image' in item or 'image_url' in item or item.type in ['image', 'image_url']) -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain images.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set image_count.value = image_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Picture ' ~ image_count.value ~ ': ' -}}\n {%- endif -%}\n {{- image_start_token ~ image_pad_token ~ image_end_token -}}\n {%- elif item is mapping and ('video' in item or 'video_url' in item or item.type in ['video', 'video_url']) -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain videos.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set video_count.value = video_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Video ' ~ video_count.value ~ ': ' -}}\n {%- endif -%}\n {{- video_start_token ~ video_pad_token ~ video_end_token -}}\n {%- elif item is string -%}\n {{- item -}}\n {%- else -%}\n {{- item | string -}}\n {%- endif -%}\n {%- endfor -%}\n {%- elif content is none -%}\n {{- '' -}}\n {%- else -%}\n {{- content | string -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- macro render_tools_prompt() -%}\n {{- '# Tools\\n\\nYou may call one or more functions to assist with the user query.' -}}\n {{- '\\n\\nYou are provided with function signatures within <tools></tools> XML tags:' -}}\n {{- '\\n<tools>\\n' -}}\n {%- set tool_ns = namespace(first=true) -%}\n {%- for tool in tools -%}\n {%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- if t.defer_loading is not defined or not t.defer_loading -%}\n {%- if not tool_ns.first -%}{{- '\\n' -}}{%- endif -%}\n {%- set tool_ns.first = false -%}\n {{- tool_to_json(t) -}}\n {%- endif -%}\n {%- endfor -%}\n {{- '\\n</tools>\\n\\n' -}}\n {{- 'For function call returns, you should first print ' ~ toolcalls_begin_token -}}\n {{- '\\nFor each function call, you should return object like:\\n' -}}\n {{- toolcall_begin_token ~ '{function-name}' -}}\n {{- argkey_begin_token ~ '{arg-key-1}' ~ argkey_end_token -}}\n {{- argvalue_begin_token ~ '{arg-value-1}' ~ argvalue_end_token -}}\n {{- argkey_begin_token ~ '{arg-key-2}' ~ argkey_end_token -}}\n {{- argvalue_begin_token ~ '{arg-value-2}' ~ argvalue_end_token -}}\n {{- '...' -}}\n {{- toolcall_end_token -}}\n {{- '\\nAt the end of function call returns, you should print ' ~ toolcalls_end_token -}}\n{%- endmacro -%}\n\n{%- macro render_tool_response(message) -%}\n {%- set content = message['content'] -%}\n {%- if content is string -%}\n {{- toolresponse_begin_token ~ content ~ toolresponse_end_token -}}\n {%- elif content is iterable and content is not mapping and content and content[0] is mapping and content[0].type == 'tool_reference' -%}\n {{- toolresponse_begin_token -}}\n {{- '<tools>\\n' -}}\n {%- for tr in content -%}\n {%- for tool in tools -%}\n {%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- if t.name == tr.name -%}\n {{- tool_to_json(t) ~ '\\n' -}}\n {%- endif -%}\n {%- endfor -%}\n {%- endfor -%}\n {{- '</tools>' -}}\n {{- toolresponse_end_token -}}\n {%- elif content is iterable and content is not mapping and content and content[0] is mapping and content[0].output is defined -%}\n {%- for tr in content -%}\n {{- toolresponse_begin_token ~ tr.output ~ toolresponse_end_token -}}\n {%- endfor -%}\n {%- else -%}\n {{- toolresponse_begin_token ~ render_content(content) ~ toolresponse_end_token -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{#- consecutive tool messages are clustered into a single tool message whose content is the list of the original tool messages; the result is written to merged_ns.messages (a macro cannot return a list) -#}\n{%- set merged_ns = namespace(messages=[]) %}\n{%- macro merge_tool_responses(messages) -%}\n {%- set merge_ns = namespace(result=[], cluster=[]) -%}\n {%- for message in messages -%}\n {%- if message['role'] == 'tool' -%}\n {%- set merge_ns.cluster = merge_ns.cluster + [message] -%}\n {%- else -%}\n {%- if merge_ns.cluster -%}\n {%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}\n {%- set merge_ns.cluster = [] -%}\n {%- endif -%}\n {%- set merge_ns.result = merge_ns.result + [message] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if merge_ns.cluster -%}\n {%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}\n {%- endif -%}\n {%- set merged_ns.messages = merge_ns.result -%}\n{%- endmacro -%}\n\n{#- render one tool cluster, reordered to follow the tool_call order of the preceding assistant turn; any missing / ambiguous id falls back to the original tool message order for the whole cluster -#}\n{%- macro render_tool_responses(tool_messages, tool_call_ids) -%}\n {%- set order_ns = namespace(ordered=[], matched=true) -%}\n {%- if tool_call_ids and tool_call_ids | length == tool_messages | length -%}\n {%- for tool_call_id in tool_call_ids -%}\n {%- set hit_ns = namespace(count=0, message=none) -%}\n {%- for tool_message in tool_messages -%}\n {%- set message_id = tool_message['tool_call_id'] if tool_message['tool_call_id'] is defined else tool_message['id'] -%}\n {%- if message_id is defined and message_id == tool_call_id -%}\n {%- set hit_ns.count = hit_ns.count + 1 -%}\n {%- set hit_ns.message = tool_message -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if hit_ns.count == 1 -%}\n {%- set order_ns.ordered = order_ns.ordered + [hit_ns.message] -%}\n {%- else -%}\n {%- set order_ns.matched = false -%}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {%- set order_ns.matched = false -%}\n {%- endif -%}\n {%- for tool_message in (order_ns.ordered if order_ns.matched else tool_messages) -%}\n {{- render_tool_response(tool_message) -}}\n {%- endfor -%}\n{%- endmacro -%}\n\n{%- set _ = merge_tool_responses(messages) %}\n{%- set normed_messages = merged_ns.messages %}\n\n{%- set ns = namespace(last_user_index=-1, has_leading_system=false) %}\n{%- if normed_messages and normed_messages[0].role == 'system' %}\n {%- set ns.has_leading_system = true %}\n{%- endif %}\n{%- for message in normed_messages %}\n {%- if message['role'] == 'user' %}\n {%- set ns.last_user_index = loop.index0 %}\n {%- endif %}\n{%- endfor %}\n\n{#- no leading system: synthesize one for tools and/or reasoning_mode -#}\n{%- if not ns.has_leading_system %}\n {{- hy_start_token ~ 'system' ~ hy_middle_token -}}\n {%- if tools %}\n {{- render_tools_prompt() -}}\n {%- endif %}\n {{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}\n {{- hy_end_token -}}\n{%- endif %}\n\n{%- set last_ns = namespace(last_is_assistant=false) %}\n{%- set prev_ns = namespace(tool_call_ids=[]) %}\n{%- for message in normed_messages %}\n {%- if message['role'] == 'system' %}\n {{- hy_start_token ~ 'system' ~ hy_middle_token -}}\n {#- tools / reasoning_mode only attach to the leading system (messages[0]) -#}\n {%- if loop.first %}\n {%- if tools %}\n {{- render_tools_prompt() -}}\n {%- endif %}\n {%- set content = render_content(message['content']) -%}\n {%- if tools and content -%}\n {{- '\\n\\n' -}}\n {%- endif -%}\n {{- content -}}\n {{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}\n {%- else %}\n {{- render_content(message['content']) -}}\n {%- endif %}\n {{- hy_end_token -}}\n {%- elif message['role'] == 'user' %}\n {{- hy_start_token ~ 'user' ~ hy_middle_token -}}\n {{- render_content(message['content']) -}}\n {{- hy_end_token -}}\n {%- elif message['role'] == 'assistant' %}\n {%- set content_body = render_content(message['content']) -%}\n {#- 'reasoning' takes precedence, fall back to 'reasoning_content' when it is empty -#}\n {%- set reasoning_text = '' %}\n {%- if message['reasoning'] is defined and message['reasoning'] is string and message['reasoning'] %}\n {%- set reasoning_text = message['reasoning'] %}\n {%- elif message['reasoning_content'] is defined and message['reasoning_content'] is string and message['reasoning_content'] %}\n {%- set reasoning_text = message['reasoning_content'] %}\n {%- endif %}\n {#- no_think overrides preserved_thinking: history is always emitted with empty think tags -#}\n {%- if reasoning_effort != 'no_think' and (preserved_thinking or loop.index0 > ns.last_user_index) and reasoning_text %}\n {%- set content = think_begin_token ~ reasoning_text ~ think_end_token ~ content_body %}\n {%- else %}\n {%- set content = think_begin_token ~ think_end_token ~ content_body %}\n {%- endif %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token -}}\n {%- if message['tool_calls'] is defined and message['tool_calls'] %}\n {#- remember the tool_call ids of this turn to order the following tool responses; an incomplete id set means \"do not reorder\" -#}\n {%- set ids_ns = namespace(ids=[], complete=true) %}\n {%- for tool in message['tool_calls'] %}\n {%- set tool_call_id = tool['id'] if tool['id'] is defined and tool['id'] else tool['tool_call_id'] %}\n {%- if tool_call_id is defined and tool_call_id %}\n {%- set ids_ns.ids = ids_ns.ids + [tool_call_id] %}\n {%- else %}\n {%- set ids_ns.complete = false %}\n {%- endif %}\n {%- endfor %}\n {%- set prev_ns.tool_call_ids = ids_ns.ids if ids_ns.complete else [] %}\n {{- content -}}\n {{- toolcalls_begin_token -}}\n {%- for tool in message['tool_calls'] -%}\n {%- set func = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- set arguments = func['arguments'] -%}\n {{- toolcall_begin_token ~ func['name'] -}}\n {%- for key, value in arguments.items() -%}\n {{- argkey_begin_token ~ key ~ argkey_end_token -}}\n {%- if value is not string -%}\n {%- set value = value | tojson(ensure_ascii=False) -%}\n {%- endif -%}\n {{- argvalue_begin_token ~ value ~ argvalue_end_token -}}\n {%- endfor -%}\n {{- toolcall_end_token -}}\n {%- endfor -%}\n {{- toolcalls_end_token -}}\n {%- else %}\n {%- if loop.last and raw_last_assistant %}\n {{- content_body -}}\n {%- else %}\n {{- content -}}\n {%- endif %}\n {%- endif %}\n {#- continuation / prefill: last assistant is still open, do not close with hy_end -#}\n {%- if not (loop.last and raw_last_assistant) %}\n {{- hy_end_token -}}\n {%- endif %}\n {%- elif message['role'] == 'tool' %}\n {{- hy_start_token ~ 'tool' ~ hy_middle_token -}}\n {{- render_tool_responses(message['content'], prev_ns.tool_call_ids) -}}\n {{- hy_end_token -}}\n {%- else %}\n {{- hy_start_token ~ message['role'] ~ hy_middle_token -}}\n {{- render_content(message['content']) -}}\n {{- hy_end_token -}}\n {%- endif %}\n {%- if message['role'] != 'assistant' or not (message['tool_calls'] is defined and message['tool_calls']) %}\n {%- set prev_ns.tool_call_ids = [] %}\n {%- endif %}\n {%- if loop.last and message['role'] == 'assistant' %}\n {%- set last_ns.last_is_assistant = true %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {%- if not last_ns.last_is_assistant %}\n {%- if reasoning_effort == 'no_think' %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token ~ think_end_token -}}\n {%- else %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token -}}\n {%- endif %}\n {%- endif %}\n{%- endif %}\n",
"context_length": 1048576,
"eos_token": "<|hy_end:6124c78e|>",
"quantize_imatrix_file": "/apdcephfs_jn5/share_300532381/harthuang/candidate_2/imatrix/merged/imatrix.attn_gate_remapped.gguf",
"total": 769907408797,
"totalFileSize": 467292398016
},
"id": "AngelSlim/Hy4-preview-GGUF",
"lastModified": "2026-09-01T05:11:08.000Z",
"likes": 100,
"modelId": "AngelSlim/Hy4-preview-GGUF",
"private": false,
"sha": "779242edccdedc2109a0b36b164263a88f015bfa",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "Hy4-preview-Q4_K_M.gguf"
},
{
"rfilename": "Hy4-preview-STQ1_0.gguf"
},
{
"rfilename": "Hy4-preview-UD-IQ1_M.gguf"
},
{
"rfilename": "README.md"
},
{
"rfilename": "hy4-preview-patch/0001-hyv4-architecture.patch"
},
{
"rfilename": "hy4-preview-patch/0002-stq1_0-quant-and-cuda.patch"
},
{
"rfilename": "hy4-preview-patch/Hy4-preview-Q4_K_M.tensortypes"
},
{
"rfilename": "hy4-preview-patch/Hy4-preview-STQ1_0.tensortypes"
},
{
"rfilename": "prima-runtime/SHA256SUMS"
},
{
"rfilename": "prima-runtime/prima-server-preview-4090-rank1-linux-x86_64-cuda-runtime.tar.gz"
},
{
"rfilename": "prima-runtime/prima-server-preview-a4000-rank0-linux-x86_64-cuda-runtime.tar.gz"
}
],
"spaces": [
"tardellirs/model-pulse"
],
"tags": [
"gguf",
"endpoints_compatible",
"region:us",
"imatrix",
"conversational"
],
"usedStorage": 932151934379
} | ||||||
| gated | falsereceipt
What the source handed over{
"_asked": "AngelSlim/Hy4-preview-GGUF",
"_id": "6a919dd7be8829f5d075d08e",
"author": "AngelSlim",
"config": {},
"createdAt": "2026-08-28T14:40:23.000Z",
"disabled": false,
"downloads": 288825,
"gated": false,
"gguf": {
"architecture": "hyv4",
"bos_token": "<|hy_start:6124c78e|>",
"chat_template": "{#- ----------‑‑‑ special token variables ‑‑‑---------- -#}\n{%- set HYTK = ':6124c78e' %}\n{%- set hy_start_token = '<|hy_start{}|>'.format(HYTK) %}\n{%- set hy_middle_token = '<|hy_middle{}|>'.format(HYTK) %}\n{%- set hy_end_token = '<|hy_end{}|>'.format(HYTK) %}\n{%- set image_start_token = '<|hy_image▁start{}|>'.format(HYTK) %}\n{%- set image_pad_token = '<|hy_image▁pad{}|>'.format(HYTK) %}\n{%- set image_end_token = '<|hy_image▁end{}|>'.format(HYTK) %}\n{%- set video_start_token = '<|hy_video▁start{}|>'.format(HYTK) %}\n{%- set video_pad_token = '<|hy_video▁pad{}|>'.format(HYTK) %}\n{%- set video_end_token = '<|hy_video▁end{}|>'.format(HYTK) %}\n{%- set think_begin_token = '<think{}>'.format(HYTK) %}\n{%- set think_end_token = '</think{}>'.format(HYTK) %}\n{%- set toolcalls_begin_token = '<tool_calls{}>'.format(HYTK) %}\n{%- set toolcalls_end_token = '</tool_calls{}>'.format(HYTK) %}\n{%- set toolcall_begin_token = '<tool_call{}>'.format(HYTK) %}\n{%- set toolcall_end_token = '</tool_call{}>'.format(HYTK) %}\n{%- set argkey_begin_token = '<arg_key{}>'.format(HYTK) %}\n{%- set argkey_end_token = '</arg_key{}>'.format(HYTK) %}\n{%- set argvalue_begin_token = '<arg_value{}>'.format(HYTK) %}\n{%- set argvalue_end_token = '</arg_value{}>'.format(HYTK) %}\n{%- set toolresponse_begin_token = '<tool_response{}>'.format(HYTK) %}\n{%- set toolresponse_end_token = '</tool_response{}>'.format(HYTK) %}\n{%- set reasoning_mode_token = '<|reasoning_mode{}|>'.format(HYTK) %}\n\n{#- ----------‑‑‑ hyperparameters variables ‑‑‑---------- -#}\n{%- if not add_generation_prompt is defined %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- if not preserved_thinking is defined %}\n {%- if not tools %}\n {%- set preserved_thinking = false %}\n {%- else %}\n {%- set preserved_thinking = true %}\n {%- endif %}\n{%- endif %}\n\n{%- if not reasoning_effort is defined %}\n {%- set reasoning_effort = 'high' %}\n{%- elif reasoning_effort not in ['high', 'low', 'no_think'] %}\n {%- if reasoning_effort is none %}\n {{- raise_exception('reasoning_effort error : None, should be no_think/low/high') }}\n {%- else %}\n {{- raise_exception('reasoning_effort error : ' + reasoning_effort + ', should be no_think/low/high') }}\n {%- endif %}\n{%- endif %}\n\n{%- if fallback_strategy is defined and fallback_strategy == 'reasoning_toolcall_retry' %}\n {%- set reasoning_effort = 'high' %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- if not raw_last_assistant is defined %}\n {%- set raw_last_assistant = false %}\n{%- endif %}\n{%- if not add_vision_id is defined %}\n {%- set add_vision_id = false %}\n{%- endif %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n\n{%- macro tool_to_json(tool) -%}\n {%- set ns_tool = namespace(first=true) -%}\n {{- '{' -}}\n {%- for k, v in tool.items() -%}\n {%- if k != 'defer_loading' and k != 'strict' -%}\n {%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}\n {%- set ns_tool.first = false -%}\n {{- '\"' ~ k ~ '\": ' ~ (v | tojson(ensure_ascii=False)) -}}\n {%- endif -%}\n {%- endfor -%}\n {{- '}' -}}\n{%- endmacro -%}\n\n{%- macro render_content(content, do_vision_count=true, is_system_content=false) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text -}}\n {%- elif item is mapping and ('image' in item or 'image_url' in item or item.type in ['image', 'image_url']) -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain images.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set image_count.value = image_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Picture ' ~ image_count.value ~ ': ' -}}\n {%- endif -%}\n {{- image_start_token ~ image_pad_token ~ image_end_token -}}\n {%- elif item is mapping and ('video' in item or 'video_url' in item or item.type in ['video', 'video_url']) -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain videos.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set video_count.value = video_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Video ' ~ video_count.value ~ ': ' -}}\n {%- endif -%}\n {{- video_start_token ~ video_pad_token ~ video_end_token -}}\n {%- elif item is string -%}\n {{- item -}}\n {%- else -%}\n {{- item | string -}}\n {%- endif -%}\n {%- endfor -%}\n {%- elif content is none -%}\n {{- '' -}}\n {%- else -%}\n {{- content | string -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- macro render_tools_prompt() -%}\n {{- '# Tools\\n\\nYou may call one or more functions to assist with the user query.' -}}\n {{- '\\n\\nYou are provided with function signatures within <tools></tools> XML tags:' -}}\n {{- '\\n<tools>\\n' -}}\n {%- set tool_ns = namespace(first=true) -%}\n {%- for tool in tools -%}\n {%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- if t.defer_loading is not defined or not t.defer_loading -%}\n {%- if not tool_ns.first -%}{{- '\\n' -}}{%- endif -%}\n {%- set tool_ns.first = false -%}\n {{- tool_to_json(t) -}}\n {%- endif -%}\n {%- endfor -%}\n {{- '\\n</tools>\\n\\n' -}}\n {{- 'For function call returns, you should first print ' ~ toolcalls_begin_token -}}\n {{- '\\nFor each function call, you should return object like:\\n' -}}\n {{- toolcall_begin_token ~ '{function-name}' -}}\n {{- argkey_begin_token ~ '{arg-key-1}' ~ argkey_end_token -}}\n {{- argvalue_begin_token ~ '{arg-value-1}' ~ argvalue_end_token -}}\n {{- argkey_begin_token ~ '{arg-key-2}' ~ argkey_end_token -}}\n {{- argvalue_begin_token ~ '{arg-value-2}' ~ argvalue_end_token -}}\n {{- '...' -}}\n {{- toolcall_end_token -}}\n {{- '\\nAt the end of function call returns, you should print ' ~ toolcalls_end_token -}}\n{%- endmacro -%}\n\n{%- macro render_tool_response(message) -%}\n {%- set content = message['content'] -%}\n {%- if content is string -%}\n {{- toolresponse_begin_token ~ content ~ toolresponse_end_token -}}\n {%- elif content is iterable and content is not mapping and content and content[0] is mapping and content[0].type == 'tool_reference' -%}\n {{- toolresponse_begin_token -}}\n {{- '<tools>\\n' -}}\n {%- for tr in content -%}\n {%- for tool in tools -%}\n {%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- if t.name == tr.name -%}\n {{- tool_to_json(t) ~ '\\n' -}}\n {%- endif -%}\n {%- endfor -%}\n {%- endfor -%}\n {{- '</tools>' -}}\n {{- toolresponse_end_token -}}\n {%- elif content is iterable and content is not mapping and content and content[0] is mapping and content[0].output is defined -%}\n {%- for tr in content -%}\n {{- toolresponse_begin_token ~ tr.output ~ toolresponse_end_token -}}\n {%- endfor -%}\n {%- else -%}\n {{- toolresponse_begin_token ~ render_content(content) ~ toolresponse_end_token -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{#- consecutive tool messages are clustered into a single tool message whose content is the list of the original tool messages; the result is written to merged_ns.messages (a macro cannot return a list) -#}\n{%- set merged_ns = namespace(messages=[]) %}\n{%- macro merge_tool_responses(messages) -%}\n {%- set merge_ns = namespace(result=[], cluster=[]) -%}\n {%- for message in messages -%}\n {%- if message['role'] == 'tool' -%}\n {%- set merge_ns.cluster = merge_ns.cluster + [message] -%}\n {%- else -%}\n {%- if merge_ns.cluster -%}\n {%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}\n {%- set merge_ns.cluster = [] -%}\n {%- endif -%}\n {%- set merge_ns.result = merge_ns.result + [message] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if merge_ns.cluster -%}\n {%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}\n {%- endif -%}\n {%- set merged_ns.messages = merge_ns.result -%}\n{%- endmacro -%}\n\n{#- render one tool cluster, reordered to follow the tool_call order of the preceding assistant turn; any missing / ambiguous id falls back to the original tool message order for the whole cluster -#}\n{%- macro render_tool_responses(tool_messages, tool_call_ids) -%}\n {%- set order_ns = namespace(ordered=[], matched=true) -%}\n {%- if tool_call_ids and tool_call_ids | length == tool_messages | length -%}\n {%- for tool_call_id in tool_call_ids -%}\n {%- set hit_ns = namespace(count=0, message=none) -%}\n {%- for tool_message in tool_messages -%}\n {%- set message_id = tool_message['tool_call_id'] if tool_message['tool_call_id'] is defined else tool_message['id'] -%}\n {%- if message_id is defined and message_id == tool_call_id -%}\n {%- set hit_ns.count = hit_ns.count + 1 -%}\n {%- set hit_ns.message = tool_message -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if hit_ns.count == 1 -%}\n {%- set order_ns.ordered = order_ns.ordered + [hit_ns.message] -%}\n {%- else -%}\n {%- set order_ns.matched = false -%}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {%- set order_ns.matched = false -%}\n {%- endif -%}\n {%- for tool_message in (order_ns.ordered if order_ns.matched else tool_messages) -%}\n {{- render_tool_response(tool_message) -}}\n {%- endfor -%}\n{%- endmacro -%}\n\n{%- set _ = merge_tool_responses(messages) %}\n{%- set normed_messages = merged_ns.messages %}\n\n{%- set ns = namespace(last_user_index=-1, has_leading_system=false) %}\n{%- if normed_messages and normed_messages[0].role == 'system' %}\n {%- set ns.has_leading_system = true %}\n{%- endif %}\n{%- for message in normed_messages %}\n {%- if message['role'] == 'user' %}\n {%- set ns.last_user_index = loop.index0 %}\n {%- endif %}\n{%- endfor %}\n\n{#- no leading system: synthesize one for tools and/or reasoning_mode -#}\n{%- if not ns.has_leading_system %}\n {{- hy_start_token ~ 'system' ~ hy_middle_token -}}\n {%- if tools %}\n {{- render_tools_prompt() -}}\n {%- endif %}\n {{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}\n {{- hy_end_token -}}\n{%- endif %}\n\n{%- set last_ns = namespace(last_is_assistant=false) %}\n{%- set prev_ns = namespace(tool_call_ids=[]) %}\n{%- for message in normed_messages %}\n {%- if message['role'] == 'system' %}\n {{- hy_start_token ~ 'system' ~ hy_middle_token -}}\n {#- tools / reasoning_mode only attach to the leading system (messages[0]) -#}\n {%- if loop.first %}\n {%- if tools %}\n {{- render_tools_prompt() -}}\n {%- endif %}\n {%- set content = render_content(message['content']) -%}\n {%- if tools and content -%}\n {{- '\\n\\n' -}}\n {%- endif -%}\n {{- content -}}\n {{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}\n {%- else %}\n {{- render_content(message['content']) -}}\n {%- endif %}\n {{- hy_end_token -}}\n {%- elif message['role'] == 'user' %}\n {{- hy_start_token ~ 'user' ~ hy_middle_token -}}\n {{- render_content(message['content']) -}}\n {{- hy_end_token -}}\n {%- elif message['role'] == 'assistant' %}\n {%- set content_body = render_content(message['content']) -%}\n {#- 'reasoning' takes precedence, fall back to 'reasoning_content' when it is empty -#}\n {%- set reasoning_text = '' %}\n {%- if message['reasoning'] is defined and message['reasoning'] is string and message['reasoning'] %}\n {%- set reasoning_text = message['reasoning'] %}\n {%- elif message['reasoning_content'] is defined and message['reasoning_content'] is string and message['reasoning_content'] %}\n {%- set reasoning_text = message['reasoning_content'] %}\n {%- endif %}\n {#- no_think overrides preserved_thinking: history is always emitted with empty think tags -#}\n {%- if reasoning_effort != 'no_think' and (preserved_thinking or loop.index0 > ns.last_user_index) and reasoning_text %}\n {%- set content = think_begin_token ~ reasoning_text ~ think_end_token ~ content_body %}\n {%- else %}\n {%- set content = think_begin_token ~ think_end_token ~ content_body %}\n {%- endif %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token -}}\n {%- if message['tool_calls'] is defined and message['tool_calls'] %}\n {#- remember the tool_call ids of this turn to order the following tool responses; an incomplete id set means \"do not reorder\" -#}\n {%- set ids_ns = namespace(ids=[], complete=true) %}\n {%- for tool in message['tool_calls'] %}\n {%- set tool_call_id = tool['id'] if tool['id'] is defined and tool['id'] else tool['tool_call_id'] %}\n {%- if tool_call_id is defined and tool_call_id %}\n {%- set ids_ns.ids = ids_ns.ids + [tool_call_id] %}\n {%- else %}\n {%- set ids_ns.complete = false %}\n {%- endif %}\n {%- endfor %}\n {%- set prev_ns.tool_call_ids = ids_ns.ids if ids_ns.complete else [] %}\n {{- content -}}\n {{- toolcalls_begin_token -}}\n {%- for tool in message['tool_calls'] -%}\n {%- set func = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- set arguments = func['arguments'] -%}\n {{- toolcall_begin_token ~ func['name'] -}}\n {%- for key, value in arguments.items() -%}\n {{- argkey_begin_token ~ key ~ argkey_end_token -}}\n {%- if value is not string -%}\n {%- set value = value | tojson(ensure_ascii=False) -%}\n {%- endif -%}\n {{- argvalue_begin_token ~ value ~ argvalue_end_token -}}\n {%- endfor -%}\n {{- toolcall_end_token -}}\n {%- endfor -%}\n {{- toolcalls_end_token -}}\n {%- else %}\n {%- if loop.last and raw_last_assistant %}\n {{- content_body -}}\n {%- else %}\n {{- content -}}\n {%- endif %}\n {%- endif %}\n {#- continuation / prefill: last assistant is still open, do not close with hy_end -#}\n {%- if not (loop.last and raw_last_assistant) %}\n {{- hy_end_token -}}\n {%- endif %}\n {%- elif message['role'] == 'tool' %}\n {{- hy_start_token ~ 'tool' ~ hy_middle_token -}}\n {{- render_tool_responses(message['content'], prev_ns.tool_call_ids) -}}\n {{- hy_end_token -}}\n {%- else %}\n {{- hy_start_token ~ message['role'] ~ hy_middle_token -}}\n {{- render_content(message['content']) -}}\n {{- hy_end_token -}}\n {%- endif %}\n {%- if message['role'] != 'assistant' or not (message['tool_calls'] is defined and message['tool_calls']) %}\n {%- set prev_ns.tool_call_ids = [] %}\n {%- endif %}\n {%- if loop.last and message['role'] == 'assistant' %}\n {%- set last_ns.last_is_assistant = true %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {%- if not last_ns.last_is_assistant %}\n {%- if reasoning_effort == 'no_think' %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token ~ think_end_token -}}\n {%- else %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token -}}\n {%- endif %}\n {%- endif %}\n{%- endif %}\n",
"context_length": 1048576,
"eos_token": "<|hy_end:6124c78e|>",
"quantize_imatrix_file": "/apdcephfs_jn5/share_300532381/harthuang/candidate_2/imatrix/merged/imatrix.attn_gate_remapped.gguf",
"total": 769907408797,
"totalFileSize": 467292398016
},
"id": "AngelSlim/Hy4-preview-GGUF",
"lastModified": "2026-09-01T05:11:08.000Z",
"likes": 100,
"modelId": "AngelSlim/Hy4-preview-GGUF",
"private": false,
"sha": "779242edccdedc2109a0b36b164263a88f015bfa",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "Hy4-preview-Q4_K_M.gguf"
},
{
"rfilename": "Hy4-preview-STQ1_0.gguf"
},
{
"rfilename": "Hy4-preview-UD-IQ1_M.gguf"
},
{
"rfilename": "README.md"
},
{
"rfilename": "hy4-preview-patch/0001-hyv4-architecture.patch"
},
{
"rfilename": "hy4-preview-patch/0002-stq1_0-quant-and-cuda.patch"
},
{
"rfilename": "hy4-preview-patch/Hy4-preview-Q4_K_M.tensortypes"
},
{
"rfilename": "hy4-preview-patch/Hy4-preview-STQ1_0.tensortypes"
},
{
"rfilename": "prima-runtime/SHA256SUMS"
},
{
"rfilename": "prima-runtime/prima-server-preview-4090-rank1-linux-x86_64-cuda-runtime.tar.gz"
},
{
"rfilename": "prima-runtime/prima-server-preview-a4000-rank0-linux-x86_64-cuda-runtime.tar.gz"
}
],
"spaces": [
"tardellirs/model-pulse"
],
"tags": [
"gguf",
"endpoints_compatible",
"region:us",
"imatrix",
"conversational"
],
"usedStorage": 932151934379
} | ||||||
| likes | 100receipt
What the source handed over{
"_asked": "AngelSlim/Hy4-preview-GGUF",
"_id": "6a919dd7be8829f5d075d08e",
"author": "AngelSlim",
"config": {},
"createdAt": "2026-08-28T14:40:23.000Z",
"disabled": false,
"downloads": 288825,
"gated": false,
"gguf": {
"architecture": "hyv4",
"bos_token": "<|hy_start:6124c78e|>",
"chat_template": "{#- ----------‑‑‑ special token variables ‑‑‑---------- -#}\n{%- set HYTK = ':6124c78e' %}\n{%- set hy_start_token = '<|hy_start{}|>'.format(HYTK) %}\n{%- set hy_middle_token = '<|hy_middle{}|>'.format(HYTK) %}\n{%- set hy_end_token = '<|hy_end{}|>'.format(HYTK) %}\n{%- set image_start_token = '<|hy_image▁start{}|>'.format(HYTK) %}\n{%- set image_pad_token = '<|hy_image▁pad{}|>'.format(HYTK) %}\n{%- set image_end_token = '<|hy_image▁end{}|>'.format(HYTK) %}\n{%- set video_start_token = '<|hy_video▁start{}|>'.format(HYTK) %}\n{%- set video_pad_token = '<|hy_video▁pad{}|>'.format(HYTK) %}\n{%- set video_end_token = '<|hy_video▁end{}|>'.format(HYTK) %}\n{%- set think_begin_token = '<think{}>'.format(HYTK) %}\n{%- set think_end_token = '</think{}>'.format(HYTK) %}\n{%- set toolcalls_begin_token = '<tool_calls{}>'.format(HYTK) %}\n{%- set toolcalls_end_token = '</tool_calls{}>'.format(HYTK) %}\n{%- set toolcall_begin_token = '<tool_call{}>'.format(HYTK) %}\n{%- set toolcall_end_token = '</tool_call{}>'.format(HYTK) %}\n{%- set argkey_begin_token = '<arg_key{}>'.format(HYTK) %}\n{%- set argkey_end_token = '</arg_key{}>'.format(HYTK) %}\n{%- set argvalue_begin_token = '<arg_value{}>'.format(HYTK) %}\n{%- set argvalue_end_token = '</arg_value{}>'.format(HYTK) %}\n{%- set toolresponse_begin_token = '<tool_response{}>'.format(HYTK) %}\n{%- set toolresponse_end_token = '</tool_response{}>'.format(HYTK) %}\n{%- set reasoning_mode_token = '<|reasoning_mode{}|>'.format(HYTK) %}\n\n{#- ----------‑‑‑ hyperparameters variables ‑‑‑---------- -#}\n{%- if not add_generation_prompt is defined %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- if not preserved_thinking is defined %}\n {%- if not tools %}\n {%- set preserved_thinking = false %}\n {%- else %}\n {%- set preserved_thinking = true %}\n {%- endif %}\n{%- endif %}\n\n{%- if not reasoning_effort is defined %}\n {%- set reasoning_effort = 'high' %}\n{%- elif reasoning_effort not in ['high', 'low', 'no_think'] %}\n {%- if reasoning_effort is none %}\n {{- raise_exception('reasoning_effort error : None, should be no_think/low/high') }}\n {%- else %}\n {{- raise_exception('reasoning_effort error : ' + reasoning_effort + ', should be no_think/low/high') }}\n {%- endif %}\n{%- endif %}\n\n{%- if fallback_strategy is defined and fallback_strategy == 'reasoning_toolcall_retry' %}\n {%- set reasoning_effort = 'high' %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- if not raw_last_assistant is defined %}\n {%- set raw_last_assistant = false %}\n{%- endif %}\n{%- if not add_vision_id is defined %}\n {%- set add_vision_id = false %}\n{%- endif %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n\n{%- macro tool_to_json(tool) -%}\n {%- set ns_tool = namespace(first=true) -%}\n {{- '{' -}}\n {%- for k, v in tool.items() -%}\n {%- if k != 'defer_loading' and k != 'strict' -%}\n {%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}\n {%- set ns_tool.first = false -%}\n {{- '\"' ~ k ~ '\": ' ~ (v | tojson(ensure_ascii=False)) -}}\n {%- endif -%}\n {%- endfor -%}\n {{- '}' -}}\n{%- endmacro -%}\n\n{%- macro render_content(content, do_vision_count=true, is_system_content=false) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text -}}\n {%- elif item is mapping and ('image' in item or 'image_url' in item or item.type in ['image', 'image_url']) -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain images.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set image_count.value = image_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Picture ' ~ image_count.value ~ ': ' -}}\n {%- endif -%}\n {{- image_start_token ~ image_pad_token ~ image_end_token -}}\n {%- elif item is mapping and ('video' in item or 'video_url' in item or item.type in ['video', 'video_url']) -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain videos.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set video_count.value = video_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Video ' ~ video_count.value ~ ': ' -}}\n {%- endif -%}\n {{- video_start_token ~ video_pad_token ~ video_end_token -}}\n {%- elif item is string -%}\n {{- item -}}\n {%- else -%}\n {{- item | string -}}\n {%- endif -%}\n {%- endfor -%}\n {%- elif content is none -%}\n {{- '' -}}\n {%- else -%}\n {{- content | string -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- macro render_tools_prompt() -%}\n {{- '# Tools\\n\\nYou may call one or more functions to assist with the user query.' -}}\n {{- '\\n\\nYou are provided with function signatures within <tools></tools> XML tags:' -}}\n {{- '\\n<tools>\\n' -}}\n {%- set tool_ns = namespace(first=true) -%}\n {%- for tool in tools -%}\n {%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- if t.defer_loading is not defined or not t.defer_loading -%}\n {%- if not tool_ns.first -%}{{- '\\n' -}}{%- endif -%}\n {%- set tool_ns.first = false -%}\n {{- tool_to_json(t) -}}\n {%- endif -%}\n {%- endfor -%}\n {{- '\\n</tools>\\n\\n' -}}\n {{- 'For function call returns, you should first print ' ~ toolcalls_begin_token -}}\n {{- '\\nFor each function call, you should return object like:\\n' -}}\n {{- toolcall_begin_token ~ '{function-name}' -}}\n {{- argkey_begin_token ~ '{arg-key-1}' ~ argkey_end_token -}}\n {{- argvalue_begin_token ~ '{arg-value-1}' ~ argvalue_end_token -}}\n {{- argkey_begin_token ~ '{arg-key-2}' ~ argkey_end_token -}}\n {{- argvalue_begin_token ~ '{arg-value-2}' ~ argvalue_end_token -}}\n {{- '...' -}}\n {{- toolcall_end_token -}}\n {{- '\\nAt the end of function call returns, you should print ' ~ toolcalls_end_token -}}\n{%- endmacro -%}\n\n{%- macro render_tool_response(message) -%}\n {%- set content = message['content'] -%}\n {%- if content is string -%}\n {{- toolresponse_begin_token ~ content ~ toolresponse_end_token -}}\n {%- elif content is iterable and content is not mapping and content and content[0] is mapping and content[0].type == 'tool_reference' -%}\n {{- toolresponse_begin_token -}}\n {{- '<tools>\\n' -}}\n {%- for tr in content -%}\n {%- for tool in tools -%}\n {%- set t = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- if t.name == tr.name -%}\n {{- tool_to_json(t) ~ '\\n' -}}\n {%- endif -%}\n {%- endfor -%}\n {%- endfor -%}\n {{- '</tools>' -}}\n {{- toolresponse_end_token -}}\n {%- elif content is iterable and content is not mapping and content and content[0] is mapping and content[0].output is defined -%}\n {%- for tr in content -%}\n {{- toolresponse_begin_token ~ tr.output ~ toolresponse_end_token -}}\n {%- endfor -%}\n {%- else -%}\n {{- toolresponse_begin_token ~ render_content(content) ~ toolresponse_end_token -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{#- consecutive tool messages are clustered into a single tool message whose content is the list of the original tool messages; the result is written to merged_ns.messages (a macro cannot return a list) -#}\n{%- set merged_ns = namespace(messages=[]) %}\n{%- macro merge_tool_responses(messages) -%}\n {%- set merge_ns = namespace(result=[], cluster=[]) -%}\n {%- for message in messages -%}\n {%- if message['role'] == 'tool' -%}\n {%- set merge_ns.cluster = merge_ns.cluster + [message] -%}\n {%- else -%}\n {%- if merge_ns.cluster -%}\n {%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}\n {%- set merge_ns.cluster = [] -%}\n {%- endif -%}\n {%- set merge_ns.result = merge_ns.result + [message] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if merge_ns.cluster -%}\n {%- set merge_ns.result = merge_ns.result + [{'role': 'tool', 'content': merge_ns.cluster}] -%}\n {%- endif -%}\n {%- set merged_ns.messages = merge_ns.result -%}\n{%- endmacro -%}\n\n{#- render one tool cluster, reordered to follow the tool_call order of the preceding assistant turn; any missing / ambiguous id falls back to the original tool message order for the whole cluster -#}\n{%- macro render_tool_responses(tool_messages, tool_call_ids) -%}\n {%- set order_ns = namespace(ordered=[], matched=true) -%}\n {%- if tool_call_ids and tool_call_ids | length == tool_messages | length -%}\n {%- for tool_call_id in tool_call_ids -%}\n {%- set hit_ns = namespace(count=0, message=none) -%}\n {%- for tool_message in tool_messages -%}\n {%- set message_id = tool_message['tool_call_id'] if tool_message['tool_call_id'] is defined else tool_message['id'] -%}\n {%- if message_id is defined and message_id == tool_call_id -%}\n {%- set hit_ns.count = hit_ns.count + 1 -%}\n {%- set hit_ns.message = tool_message -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if hit_ns.count == 1 -%}\n {%- set order_ns.ordered = order_ns.ordered + [hit_ns.message] -%}\n {%- else -%}\n {%- set order_ns.matched = false -%}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {%- set order_ns.matched = false -%}\n {%- endif -%}\n {%- for tool_message in (order_ns.ordered if order_ns.matched else tool_messages) -%}\n {{- render_tool_response(tool_message) -}}\n {%- endfor -%}\n{%- endmacro -%}\n\n{%- set _ = merge_tool_responses(messages) %}\n{%- set normed_messages = merged_ns.messages %}\n\n{%- set ns = namespace(last_user_index=-1, has_leading_system=false) %}\n{%- if normed_messages and normed_messages[0].role == 'system' %}\n {%- set ns.has_leading_system = true %}\n{%- endif %}\n{%- for message in normed_messages %}\n {%- if message['role'] == 'user' %}\n {%- set ns.last_user_index = loop.index0 %}\n {%- endif %}\n{%- endfor %}\n\n{#- no leading system: synthesize one for tools and/or reasoning_mode -#}\n{%- if not ns.has_leading_system %}\n {{- hy_start_token ~ 'system' ~ hy_middle_token -}}\n {%- if tools %}\n {{- render_tools_prompt() -}}\n {%- endif %}\n {{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}\n {{- hy_end_token -}}\n{%- endif %}\n\n{%- set last_ns = namespace(last_is_assistant=false) %}\n{%- set prev_ns = namespace(tool_call_ids=[]) %}\n{%- for message in normed_messages %}\n {%- if message['role'] == 'system' %}\n {{- hy_start_token ~ 'system' ~ hy_middle_token -}}\n {#- tools / reasoning_mode only attach to the leading system (messages[0]) -#}\n {%- if loop.first %}\n {%- if tools %}\n {{- render_tools_prompt() -}}\n {%- endif %}\n {%- set content = render_content(message['content']) -%}\n {%- if tools and content -%}\n {{- '\\n\\n' -}}\n {%- endif -%}\n {{- content -}}\n {{- reasoning_mode_token ~ 'reasoning_effort:' ~ reasoning_effort -}}\n {%- else %}\n {{- render_content(message['content']) -}}\n {%- endif %}\n {{- hy_end_token -}}\n {%- elif message['role'] == 'user' %}\n {{- hy_start_token ~ 'user' ~ hy_middle_token -}}\n {{- render_content(message['content']) -}}\n {{- hy_end_token -}}\n {%- elif message['role'] == 'assistant' %}\n {%- set content_body = render_content(message['content']) -%}\n {#- 'reasoning' takes precedence, fall back to 'reasoning_content' when it is empty -#}\n {%- set reasoning_text = '' %}\n {%- if message['reasoning'] is defined and message['reasoning'] is string and message['reasoning'] %}\n {%- set reasoning_text = message['reasoning'] %}\n {%- elif message['reasoning_content'] is defined and message['reasoning_content'] is string and message['reasoning_content'] %}\n {%- set reasoning_text = message['reasoning_content'] %}\n {%- endif %}\n {#- no_think overrides preserved_thinking: history is always emitted with empty think tags -#}\n {%- if reasoning_effort != 'no_think' and (preserved_thinking or loop.index0 > ns.last_user_index) and reasoning_text %}\n {%- set content = think_begin_token ~ reasoning_text ~ think_end_token ~ content_body %}\n {%- else %}\n {%- set content = think_begin_token ~ think_end_token ~ content_body %}\n {%- endif %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token -}}\n {%- if message['tool_calls'] is defined and message['tool_calls'] %}\n {#- remember the tool_call ids of this turn to order the following tool responses; an incomplete id set means \"do not reorder\" -#}\n {%- set ids_ns = namespace(ids=[], complete=true) %}\n {%- for tool in message['tool_calls'] %}\n {%- set tool_call_id = tool['id'] if tool['id'] is defined and tool['id'] else tool['tool_call_id'] %}\n {%- if tool_call_id is defined and tool_call_id %}\n {%- set ids_ns.ids = ids_ns.ids + [tool_call_id] %}\n {%- else %}\n {%- set ids_ns.complete = false %}\n {%- endif %}\n {%- endfor %}\n {%- set prev_ns.tool_call_ids = ids_ns.ids if ids_ns.complete else [] %}\n {{- content -}}\n {{- toolcalls_begin_token -}}\n {%- for tool in message['tool_calls'] -%}\n {%- set func = tool['function'] if tool is mapping and 'function' in tool else tool -%}\n {%- set arguments = func['arguments'] -%}\n {{- toolcall_begin_token ~ func['name'] -}}\n {%- for key, value in arguments.items() -%}\n {{- argkey_begin_token ~ key ~ argkey_end_token -}}\n {%- if value is not string -%}\n {%- set value = value | tojson(ensure_ascii=False) -%}\n {%- endif -%}\n {{- argvalue_begin_token ~ value ~ argvalue_end_token -}}\n {%- endfor -%}\n {{- toolcall_end_token -}}\n {%- endfor -%}\n {{- toolcalls_end_token -}}\n {%- else %}\n {%- if loop.last and raw_last_assistant %}\n {{- content_body -}}\n {%- else %}\n {{- content -}}\n {%- endif %}\n {%- endif %}\n {#- continuation / prefill: last assistant is still open, do not close with hy_end -#}\n {%- if not (loop.last and raw_last_assistant) %}\n {{- hy_end_token -}}\n {%- endif %}\n {%- elif message['role'] == 'tool' %}\n {{- hy_start_token ~ 'tool' ~ hy_middle_token -}}\n {{- render_tool_responses(message['content'], prev_ns.tool_call_ids) -}}\n {{- hy_end_token -}}\n {%- else %}\n {{- hy_start_token ~ message['role'] ~ hy_middle_token -}}\n {{- render_content(message['content']) -}}\n {{- hy_end_token -}}\n {%- endif %}\n {%- if message['role'] != 'assistant' or not (message['tool_calls'] is defined and message['tool_calls']) %}\n {%- set prev_ns.tool_call_ids = [] %}\n {%- endif %}\n {%- if loop.last and message['role'] == 'assistant' %}\n {%- set last_ns.last_is_assistant = true %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {%- if not last_ns.last_is_assistant %}\n {%- if reasoning_effort == 'no_think' %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token ~ think_end_token -}}\n {%- else %}\n {{- hy_start_token ~ 'assistant' ~ hy_middle_token ~ think_begin_token -}}\n {%- endif %}\n {%- endif %}\n{%- endif %}\n",
"context_length": 1048576,
"eos_token": "<|hy_end:6124c78e|>",
"quantize_imatrix_file": "/apdcephfs_jn5/share_300532381/harthuang/candidate_2/imatrix/merged/imatrix.attn_gate_remapped.gguf",
"total": 769907408797,
"totalFileSize": 467292398016
},
"id": "AngelSlim/Hy4-preview-GGUF",
"lastModified": "2026-09-01T05:11:08.000Z",
"likes": 100,
"modelId": "AngelSlim/Hy4-preview-GGUF",
"private": false,
"sha": "779242edccdedc2109a0b36b164263a88f015bfa",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "Hy4-preview-Q4_K_M.gguf"
},
{
"rfilename": "Hy4-preview-STQ1_0.gguf"
},
{
"rfilename": "Hy4-preview-UD-IQ1_M.gguf"
},
{
"rfilename": "README.md"
},
{
"rfilename": "hy4-preview-patch/0001-hyv4-architecture.patch"
},
{
"rfilename": "hy4-preview-patch/0002-stq1_0-quant-and-cuda.patch"
},
{
"rfilename": "hy4-preview-patch/Hy4-preview-Q4_K_M.tensortypes"
},
{
"rfilename": "hy4-preview-patch/Hy4-preview-STQ1_0.tensortypes"
},
{
"rfilename": "prima-runtime/SHA256SUMS"
},
{
"rfilename": "prima-runtime/prima-server-preview-4090-rank1-linux-x86_64-cuda-runtime.tar.gz"
},
{
"rfilename": "prima-runtime/prima-server-preview-a4000-rank0-linux-x86_64-cuda-runtime.tar.gz"
}
],
"spaces": [
"tardellirs/model-pulse"
],
"tags": [
"gguf",
"endpoints_compatible",
"region:us",
"imatrix",
"conversational"
],
"usedStorage": 932151934379
} |
Text
This source's terms allow its title, its values and a link here, not its text. It is at https://huggingface.co/AngelSlim/Hy4-preview-GGUF.