Add files using upload-large-folder tool
Browse files- README.md +1 -4
- chat_template.jinja +10 -10
README.md
CHANGED
@@ -5,9 +5,6 @@ library_name: mlx
|
|
5 |
tags:
|
6 |
- vllm
|
7 |
- mlx
|
8 |
-
language:
|
9 |
-
- en
|
10 |
-
- zh
|
11 |
base_model: ByteDance-Seed/Seed-OSS-36B-Instruct
|
12 |
---
|
13 |
|
@@ -15,7 +12,7 @@ base_model: ByteDance-Seed/Seed-OSS-36B-Instruct
|
|
15 |
|
16 |
This model [Seed-OSS-36B-Instruct-q6-hi-mlx](https://huggingface.co/Seed-OSS-36B-Instruct-q6-hi-mlx) was
|
17 |
converted to MLX format from [ByteDance-Seed/Seed-OSS-36B-Instruct](https://huggingface.co/ByteDance-Seed/Seed-OSS-36B-Instruct)
|
18 |
-
using mlx-lm version **0.26.
|
19 |
|
20 |
## Use with mlx
|
21 |
|
|
|
5 |
tags:
|
6 |
- vllm
|
7 |
- mlx
|
|
|
|
|
|
|
8 |
base_model: ByteDance-Seed/Seed-OSS-36B-Instruct
|
9 |
---
|
10 |
|
|
|
12 |
|
13 |
This model [Seed-OSS-36B-Instruct-q6-hi-mlx](https://huggingface.co/Seed-OSS-36B-Instruct-q6-hi-mlx) was
|
14 |
converted to MLX format from [ByteDance-Seed/Seed-OSS-36B-Instruct](https://huggingface.co/ByteDance-Seed/Seed-OSS-36B-Instruct)
|
15 |
+
using mlx-lm version **0.26.4**.
|
16 |
|
17 |
## Use with mlx
|
18 |
|
chat_template.jinja
CHANGED
@@ -21,25 +21,25 @@
|
|
21 |
8192: 1024,
|
22 |
16384: 1024
|
23 |
} -%}
|
24 |
-
{#
|
25 |
{%- set ns = namespace(interval = None) -%}
|
26 |
{%- for k, v in budget_reflections_v05 | dictsort -%}
|
27 |
{%- if ns.interval is none and thinking_budget <= k -%}
|
28 |
{%- set ns.interval = v -%}
|
29 |
{%- endif -%}
|
30 |
{%- endfor -%}
|
31 |
-
{#
|
32 |
{%- if ns.interval is none -%}
|
33 |
{%- set ns.interval = budget_reflections_v05[16384] -%}
|
34 |
{%- endif -%}
|
35 |
-
{# ----------
|
36 |
{%- if messages[0]["role"] == "system" %}
|
37 |
{%- set system_message = messages[0]["content"] %}
|
38 |
{%- set loop_messages = messages[1:] %}
|
39 |
{%- else %}
|
40 |
{%- set loop_messages = messages %}
|
41 |
{%- endif %}
|
42 |
-
{# ----------
|
43 |
{%- if not tools is defined or tools is none %}
|
44 |
{%- set tools = [] %}
|
45 |
{%- endif %}
|
@@ -51,7 +51,7 @@
|
|
51 |
{%- elif t == "array" -%}list
|
52 |
{%- else -%}Any{%- endif -%}
|
53 |
{%- endmacro -%}
|
54 |
-
{# ----------
|
55 |
{%- if system_message is defined %}
|
56 |
{{ bos_token + "system\n" + system_message }}
|
57 |
{%- else %}
|
@@ -105,7 +105,7 @@ def {{ item.function.name }}(
|
|
105 |
|
106 |
{{"工具调用请遵循如下格式:\n<seed:tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>value_1</parameter>\n<parameter=example_parameter_2>This is the value for the second parameter\nthat can span\nmultiple lines</parameter>\n</function>\n</seed:tool_call>\n"}}
|
107 |
{%- endif %}
|
108 |
-
{#
|
109 |
{%- if system_message is defined or tools is iterable and tools | length > 0 %}
|
110 |
{{ eos_token }}
|
111 |
{%- endif %}
|
@@ -121,7 +121,7 @@ def {{ item.function.name }}(
|
|
121 |
{{ eos_token }}
|
122 |
{%- endif %}
|
123 |
{%- endif %}
|
124 |
-
{# ----------
|
125 |
{%- for message in loop_messages %}
|
126 |
{%- if message.role == "assistant"
|
127 |
and message.tool_calls is defined
|
@@ -157,15 +157,15 @@ def {{ item.function.name }}(
|
|
157 |
{%- if message.content is defined and message.content is string and message.content | trim | length > 0 %}
|
158 |
{{ "\n" + message.content | trim + eos_token }}
|
159 |
{%- endif %}
|
160 |
-
{#
|
161 |
{%- else %}
|
162 |
{{ bos_token + message.role + "\n" + message.content + eos_token }}
|
163 |
{%- endif %}
|
164 |
{%- endfor %}
|
165 |
-
{# ----------
|
166 |
{%- if add_generation_prompt %}
|
167 |
{{ bos_token+"assistant\n" }}
|
168 |
{%- if thinking_budget == 0 %}
|
169 |
-
{{ think_begin_token+budget_begin_token }}
|
170 |
{%- endif %}
|
171 |
{%- endif %}
|
|
|
21 |
8192: 1024,
|
22 |
16384: 1024
|
23 |
} -%}
|
24 |
+
{# Find the first gear that is greater than or equal to the thinking_budget. #}
|
25 |
{%- set ns = namespace(interval = None) -%}
|
26 |
{%- for k, v in budget_reflections_v05 | dictsort -%}
|
27 |
{%- if ns.interval is none and thinking_budget <= k -%}
|
28 |
{%- set ns.interval = v -%}
|
29 |
{%- endif -%}
|
30 |
{%- endfor -%}
|
31 |
+
{# If it exceeds the maximum gear, use the value of the last gear #}
|
32 |
{%- if ns.interval is none -%}
|
33 |
{%- set ns.interval = budget_reflections_v05[16384] -%}
|
34 |
{%- endif -%}
|
35 |
+
{# ---------- Preprocess the system message ---------- #}
|
36 |
{%- if messages[0]["role"] == "system" %}
|
37 |
{%- set system_message = messages[0]["content"] %}
|
38 |
{%- set loop_messages = messages[1:] %}
|
39 |
{%- else %}
|
40 |
{%- set loop_messages = messages %}
|
41 |
{%- endif %}
|
42 |
+
{# ---------- Ensure tools exist ---------- #}
|
43 |
{%- if not tools is defined or tools is none %}
|
44 |
{%- set tools = [] %}
|
45 |
{%- endif %}
|
|
|
51 |
{%- elif t == "array" -%}list
|
52 |
{%- else -%}Any{%- endif -%}
|
53 |
{%- endmacro -%}
|
54 |
+
{# ---------- Output the system block ---------- #}
|
55 |
{%- if system_message is defined %}
|
56 |
{{ bos_token + "system\n" + system_message }}
|
57 |
{%- else %}
|
|
|
105 |
|
106 |
{{"工具调用请遵循如下格式:\n<seed:tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>value_1</parameter>\n<parameter=example_parameter_2>This is the value for the second parameter\nthat can span\nmultiple lines</parameter>\n</function>\n</seed:tool_call>\n"}}
|
107 |
{%- endif %}
|
108 |
+
{# End the system block line #}
|
109 |
{%- if system_message is defined or tools is iterable and tools | length > 0 %}
|
110 |
{{ eos_token }}
|
111 |
{%- endif %}
|
|
|
121 |
{{ eos_token }}
|
122 |
{%- endif %}
|
123 |
{%- endif %}
|
124 |
+
{# ---------- List the historical messages one by one ---------- #}
|
125 |
{%- for message in loop_messages %}
|
126 |
{%- if message.role == "assistant"
|
127 |
and message.tool_calls is defined
|
|
|
157 |
{%- if message.content is defined and message.content is string and message.content | trim | length > 0 %}
|
158 |
{{ "\n" + message.content | trim + eos_token }}
|
159 |
{%- endif %}
|
160 |
+
{# Include the tool role #}
|
161 |
{%- else %}
|
162 |
{{ bos_token + message.role + "\n" + message.content + eos_token }}
|
163 |
{%- endif %}
|
164 |
{%- endfor %}
|
165 |
+
{# ---------- Control the model to start continuation ---------- #}
|
166 |
{%- if add_generation_prompt %}
|
167 |
{{ bos_token+"assistant\n" }}
|
168 |
{%- if thinking_budget == 0 %}
|
169 |
+
{{ think_begin_token + "\n" + budget_begin_token + "The current thinking budget is 0, so I will directly start answering the question." + budget_end_token + "\n" + think_end_token }}
|
170 |
{%- endif %}
|
171 |
{%- endif %}
|