Commit
·
624f292
1
Parent(s):
8b91580
Update README.md & chat template
Browse files- README.md +3 -2
- chat_template.jinja +8 -8
README.md
CHANGED
|
@@ -110,7 +110,7 @@ You can run EXAONE models locally using llama.cpp by following these steps:
|
|
| 110 |
|
| 111 |
4. Generate result with greedy decoding.
|
| 112 |
```bash
|
| 113 |
-
llama-cli -m EXAONE-4.0-32B-
|
| 114 |
-fa -ngl 65 \
|
| 115 |
--temp 0.0 --top-k 1 \
|
| 116 |
-f inputs.txt -no-cnv
|
|
@@ -144,7 +144,8 @@ You can run EXAONE models locally using llama.cpp by following these steps:
|
|
| 144 |
],
|
| 145 |
"max_tokens": 1024,
|
| 146 |
"temperature": 0.6,
|
| 147 |
-
"top_p": 0.95
|
|
|
|
| 148 |
}'
|
| 149 |
```
|
| 150 |
|
|
|
|
| 110 |
|
| 111 |
4. Generate result with greedy decoding.
|
| 112 |
```bash
|
| 113 |
+
llama-cli -m EXAONE-4.0-32B-Q4_K_M.gguf \
|
| 114 |
-fa -ngl 65 \
|
| 115 |
--temp 0.0 --top-k 1 \
|
| 116 |
-f inputs.txt -no-cnv
|
|
|
|
| 144 |
],
|
| 145 |
"max_tokens": 1024,
|
| 146 |
"temperature": 0.6,
|
| 147 |
+
"top_p": 0.95,
|
| 148 |
+
"chat_template_kwargs": {"enable_thinking": false}
|
| 149 |
}'
|
| 150 |
```
|
| 151 |
|
chat_template.jinja
CHANGED
|
@@ -17,7 +17,7 @@
|
|
| 17 |
{{- "\nHere are the tools available to you in JSON format within <tool> and </tool> tags:\n" }}
|
| 18 |
{%- for tool in tools %}
|
| 19 |
{{- "<tool>" }}
|
| 20 |
-
{{- tool | safe }}
|
| 21 |
{{- "</tool>\n" }}
|
| 22 |
{%- endfor %}
|
| 23 |
|
|
@@ -38,7 +38,7 @@
|
|
| 38 |
{%- for i in range(messages | length) %}
|
| 39 |
{%- set msg = messages[i] %}
|
| 40 |
{%- set role = msg.role %}
|
| 41 |
-
{% if role is not none and role.class is not none and role
|
| 42 |
{{- raise_exception('Unknown role: ' ~ role) }}
|
| 43 |
{%- endif %}
|
| 44 |
|
|
@@ -51,17 +51,17 @@
|
|
| 51 |
{%- endif %}
|
| 52 |
{{- end_of_turn -}}
|
| 53 |
{%- continue %}
|
| 54 |
-
{%- elif tools is defined and tools %}
|
| 55 |
{{- role_indicators['system'] }}
|
| 56 |
{{- available_tools(tools) }}
|
| 57 |
-
{{- end_of_turn -}}
|
| 58 |
{%- endif %}
|
| 59 |
{%- endif %}
|
| 60 |
|
| 61 |
{%- if role == 'assistant' %}
|
| 62 |
{{- role_indicators['assistant'] }}
|
| 63 |
|
| 64 |
-
{%- if msg.content %}
|
| 65 |
{%- if "</think>" in msg.content %}
|
| 66 |
{%- set content = msg.content.split('</think>')[-1].strip() %}
|
| 67 |
{%- set reasoning_content = msg.content.split('</think>')[0].strip() %}
|
|
@@ -105,7 +105,7 @@
|
|
| 105 |
{{- raise_exception('arguments or parameters are mandatory: ' ~ tool_call) }}
|
| 106 |
{%- endif %}
|
| 107 |
|
| 108 |
-
{{- "<tool_call>" }}{"name": "{{- tool_call.name }}", "arguments": {{ arguments | safe }}}{{- "</tool_call>" }}
|
| 109 |
|
| 110 |
{%- if not loop.last %}
|
| 111 |
{{- "\n" }}
|
|
@@ -119,8 +119,8 @@
|
|
| 119 |
{%- if i == 0 or messages[i - 1].role != "tool" %}
|
| 120 |
{{- role_indicators['tool'] }}
|
| 121 |
{%- endif %}
|
| 122 |
-
{%- if msg.content is defined %}
|
| 123 |
-
{{- "<tool_result>" }}{"result": {{ msg.content | safe }}}{{- "</tool_result>" }}
|
| 124 |
{%- endif %}
|
| 125 |
{%- if loop.last or messages[i + 1].role != "tool" %}
|
| 126 |
{{- end_of_turn -}}
|
|
|
|
| 17 |
{{- "\nHere are the tools available to you in JSON format within <tool> and </tool> tags:\n" }}
|
| 18 |
{%- for tool in tools %}
|
| 19 |
{{- "<tool>" }}
|
| 20 |
+
{{- tool | tojson | safe }}
|
| 21 |
{{- "</tool>\n" }}
|
| 22 |
{%- endfor %}
|
| 23 |
|
|
|
|
| 38 |
{%- for i in range(messages | length) %}
|
| 39 |
{%- set msg = messages[i] %}
|
| 40 |
{%- set role = msg.role %}
|
| 41 |
+
{% if role is not none and role.class is not none and not role in role_indicators %}
|
| 42 |
{{- raise_exception('Unknown role: ' ~ role) }}
|
| 43 |
{%- endif %}
|
| 44 |
|
|
|
|
| 51 |
{%- endif %}
|
| 52 |
{{- end_of_turn -}}
|
| 53 |
{%- continue %}
|
| 54 |
+
{%- elif tools is defined and tools %}
|
| 55 |
{{- role_indicators['system'] }}
|
| 56 |
{{- available_tools(tools) }}
|
| 57 |
+
{{- end_of_turn -}}
|
| 58 |
{%- endif %}
|
| 59 |
{%- endif %}
|
| 60 |
|
| 61 |
{%- if role == 'assistant' %}
|
| 62 |
{{- role_indicators['assistant'] }}
|
| 63 |
|
| 64 |
+
{%- if msg.content %}
|
| 65 |
{%- if "</think>" in msg.content %}
|
| 66 |
{%- set content = msg.content.split('</think>')[-1].strip() %}
|
| 67 |
{%- set reasoning_content = msg.content.split('</think>')[0].strip() %}
|
|
|
|
| 105 |
{{- raise_exception('arguments or parameters are mandatory: ' ~ tool_call) }}
|
| 106 |
{%- endif %}
|
| 107 |
|
| 108 |
+
{{- "<tool_call>" }}{"name": "{{- tool_call.name }}", "arguments": {{ arguments | tojson | safe }}}{{- "</tool_call>" }}
|
| 109 |
|
| 110 |
{%- if not loop.last %}
|
| 111 |
{{- "\n" }}
|
|
|
|
| 119 |
{%- if i == 0 or messages[i - 1].role != "tool" %}
|
| 120 |
{{- role_indicators['tool'] }}
|
| 121 |
{%- endif %}
|
| 122 |
+
{%- if msg.content is defined %}
|
| 123 |
+
{{- "<tool_result>" }}{"result": {{ msg.content | tojson | safe }}}{{- "</tool_result>" }}
|
| 124 |
{%- endif %}
|
| 125 |
{%- if loop.last or messages[i + 1].role != "tool" %}
|
| 126 |
{{- end_of_turn -}}
|