csabakecskemeti commited on
Commit
6fc97b9
·
verified ·
1 Parent(s): 7f138f3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +104 -0
README.md CHANGED
@@ -4,6 +4,110 @@ base_model:
4
  pipeline_tag: text-generation
5
  ---
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  [<img src="https://raw.githubusercontent.com/csabakecskemeti/devquasar/main/dq_logo_black-transparent.png" width="200"/>](https://devquasar.com)
8
 
9
  Quantized version of: [Qwen/Qwen3-30B-A3B](https://huggingface.co/Qwen/Qwen3-30B-A3B)
 
4
  pipeline_tag: text-generation
5
  ---
6
 
7
+ ## LMStudio users!
8
+ Please update the chat prompt template of the model. Go to My models -> Actions (gear) edit model default parameters ->
9
+ Prompt -> Prompt template. Update the Jinja template.
10
+
11
+ Correct JINJA:
12
+ ```
13
+ {%- if tools %}
14
+ {{- '<|im_start|>system\n' }}
15
+ {%- if messages[0].role == 'system' %}
16
+ {{- messages[0].content + '\n\n' }}
17
+ {%- endif %}
18
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
19
+ {%- for tool in tools %}
20
+ {{- "\n" }}
21
+ {{- tool | tojson }}
22
+ {%- endfor %}
23
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
24
+ {%- else %}
25
+ {%- if messages[0].role == 'system' %}
26
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
27
+ {%- endif %}
28
+ {%- endif %}
29
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
30
+ {%- for message in messages[::-1] %}
31
+ {%- set index = (messages|length - 1) - loop.index0 %}
32
+ {%- set tool_start = "<tool_response>" %}
33
+ {%- set tool_start_length = tool_start|length %}
34
+ {%- set start_of_message = message.content[:tool_start_length] %}
35
+ {%- set tool_end = "</tool_response>" %}
36
+ {%- set tool_end_length = tool_end|length %}
37
+ {%- set start_pos = (message.content|length) - tool_end_length %}
38
+ {%- if start_pos < 0 %}
39
+ {%- set start_pos = 0 %}
40
+ {%- endif %}
41
+ {%- set end_of_message = message.content[start_pos:] %}
42
+ {%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
43
+ {%- set ns.multi_step_tool = false %}
44
+ {%- set ns.last_query_index = index %}
45
+ {%- endif %}
46
+ {%- endfor %}
47
+ {%- for message in messages %}
48
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
49
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
50
+ {%- elif message.role == "assistant" %}
51
+ {%- set content = message.content %}
52
+ {%- set reasoning_content = '' %}
53
+ {%- if message.reasoning_content is defined and message.reasoning_content is not none %}
54
+ {%- set reasoning_content = message.reasoning_content %}
55
+ {%- else %}
56
+ {%- if '</think>' in message.content %}
57
+ {%- set content = (message.content.split('</think>')|last).lstrip('\n') %}
58
+ {%- set reasoning_content = (message.content.split('</think>')|first).rstrip('\n') %}
59
+ {%- set reasoning_content = (reasoning_content.split('<think>')|last).lstrip('\n') %}
60
+ {%- endif %}
61
+ {%- endif %}
62
+ {%- if loop.index0 > ns.last_query_index %}
63
+ {%- if loop.last or (not loop.last and reasoning_content) %}
64
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
65
+ {%- else %}
66
+ {{- '<|im_start|>' + message.role + '\n' + content }}
67
+ {%- endif %}
68
+ {%- else %}
69
+ {{- '<|im_start|>' + message.role + '\n' + content }}
70
+ {%- endif %}
71
+ {%- if message.tool_calls %}
72
+ {%- for tool_call in message.tool_calls %}
73
+ {%- if (loop.first and content) or (not loop.first) %}
74
+ {{- '\n' }}
75
+ {%- endif %}
76
+ {%- if tool_call.function %}
77
+ {%- set tool_call = tool_call.function %}
78
+ {%- endif %}
79
+ {{- '<tool_call>\n{"name": "' }}
80
+ {{- tool_call.name }}
81
+ {{- '", "arguments": ' }}
82
+ {%- if tool_call.arguments is string %}
83
+ {{- tool_call.arguments }}
84
+ {%- else %}
85
+ {{- tool_call.arguments | tojson }}
86
+ {%- endif %}
87
+ {{- '}\n</tool_call>' }}
88
+ {%- endfor %}
89
+ {%- endif %}
90
+ {{- '<|im_end|>\n' }}
91
+ {%- elif message.role == "tool" %}
92
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
93
+ {{- '<|im_start|>user' }}
94
+ {%- endif %}
95
+ {{- '\n<tool_response>\n' }}
96
+ {{- message.content }}
97
+ {{- '\n</tool_response>' }}
98
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
99
+ {{- '<|im_end|>\n' }}
100
+ {%- endif %}
101
+ {%- endif %}
102
+ {%- endfor %}
103
+ {%- if add_generation_prompt %}
104
+ {{- '<|im_start|>assistant\n' }}
105
+ {%- if enable_thinking is defined and enable_thinking is false %}
106
+ {{- '<think>\n\n</think>\n\n' }}
107
+ {%- endif %}
108
+ {%- endif %}
109
+ ```
110
+
111
  [<img src="https://raw.githubusercontent.com/csabakecskemeti/devquasar/main/dq_logo_black-transparent.png" width="200"/>](https://devquasar.com)
112
 
113
  Quantized version of: [Qwen/Qwen3-30B-A3B](https://huggingface.co/Qwen/Qwen3-30B-A3B)