Share my fix (on/off thought content) when running nex-m2-mini gguf with llama.cpp.

#3
by zhijin123 - opened

Firstly, extract the Nex-N2-mini gguf's chat/prompt template and save it (e.g. xxxxxx.json. If you don't know how to extract, use lmstudio download gguf and copy the prompt template).
Then change as below -- only one change.
Now, you can run llama.cpp cli/server with command "--jinja --chat-template-file xxxxxx.json"

Template from nex-n2-mini gguf
......
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- if enable_thinking is defined and enable_thinking is false %}
{{- '\n\n\n\n' }}
{%- else %}
{{- '<think>' }}
{%- endif %}
{%- endif %}

Change - only add back "\n" (from <think> to <think>\n)
......
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- if enable_thinking is defined and enable_thinking is false %}
{{- '\n\n\n\n' }}
{%- else %}
{{- '<think>\n' }} <== here
{%- endif %}
{%- endif %}

zhijin123 changed discussion title from Share my fix when running nex-m2-mini gguf with llama.cpp. to Share my fix (suppress thought content) when running nex-m2-mini gguf with llama.cpp.
zhijin123 changed discussion title from Share my fix (suppress thought content) when running nex-m2-mini gguf with llama.cpp. to Share my fix (on/off thought content) when running nex-m2-mini gguf with llama.cpp.

Sign up or log in to comment