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

#2
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

Yes, this change makes the model work properly. Why is this thing happening tho? What went wrong during the training of the model?

This model is better then Qwen 3.6 27B Q8 ! Resolved my code problem that Qwen 3.6 27B Q8 did not solve in 5 runs, it ran bash terminal inspected pyhon code and database simulated the problem and debugged it.

Sign up or log in to comment