[GH-ISSUE #8965] Reasoning models (All Deepseek models/merged models i.e. FuseO1) missing <think> after running ollama create MODEL #31578

Closed
opened 2026-04-22 12:09:24 -05:00 by GiteaMirror · 14 comments
Owner

Originally created by @Sub0X on GitHub (Feb 9, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8965

What is the issue?

All reasoning related models after running ollama create MODEL has failed to produce in the beginning. When using llama.cpp to run the gguf file via llama-cli, it works fine as the tags are there.

Relevant reddit post: https://www.reddit.com/r/OpenWebUI/comments/1ik8n2z/reasoning_models_from_huggingface_missing/

Ollama run output:

(base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> ollama create DeepSeek-R1-Distill-Qwen-32B:q5_K_S
gathering model components
copying file sha256:b0777aa14d13b6ab9ea8dda87e948b5ff37f95282c809db38886f0427fb51bb4 100%
parsing GGUF
using existing layer sha256:b0777aa14d13b6ab9ea8dda87e948b5ff37f95282c809db38886f0427fb51bb4 
creating new layer sha256:3399a9e3d66a4b9c9a10d64fcf94807ab26fd48d75e38c3900c0423935e7566d 
creating new layer sha256:14f461e5eadec4c5850470d58b26f138e8e07da88842d58dc134af99558a893a 
creating new layer sha256:381f8a536fbddb69e1a331f11c40f300fdf44cf427b90408cd807f0141259b4d 
writing manifest 
success 
(base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> ollama run DeepSeek-R1-Distill-Qwen-32B:q5_K_S 
>>> How many r's are in the word Strawberry?
Alright, so I need to figure out how many times the letter 'r' appears in the word "Strawberry." Hmm, okay, let's start by spelling it out and looking at each letter one by one. 

First, I'll write down the word: S-T-R-A-W-B-E-R-R-Y. Now, I need to go through each character and count whenever an 'r' shows up.

Starting from the beginning:
1. S – that's not an 'r'.
2. T – also not.
3. R – here we go, that's one 'r'.
4. A – nope.
5. W – still not.
6. B – moving on.
7. E – almost there.
8. R – another one! That brings the count to two.
9. R – wait, is there another 'r' right after? Yes, so that's three 'r's now.
10. Y – and we're done.

Wait a second, did I count correctly? Let me double-check because sometimes it's easy to miscount when letters are close together. So going back through the word: S-T-R-A-W-B-E-R-R-Y.

Breaking it down:
- The third letter is 'R' (1).
- Then after E comes another 'R' (2).
- And immediately following that, there's yet another 'R' (3).

So yes, I think there are three 'r's in "Strawberry." That seems a bit high, but when you look at the word, it does have two 'r's back to back after the E. So counting each one individually gives us three.

I guess sometimes words can have multiple instances of the same letter, especially vowels or consonants that are used repeatedly for pronunciation purposes. In this case, "Strawberry" uses 'r' three times to help with how it       
sounds when spoken aloud.

Another way to confirm is by writing out each position and labeling them:
1. S
2. T
3. R (count 1)
4. A
5. W
6. B
7. E
8. R (count 2)
9. R (count 3)
10. Y

Yep, that's three 'r's in total. I don't think there's any chance of missing one because the word isn't too long, and the letters are pretty straightforward once you break them down.

So after carefully going through each letter and double-checking my count, I'm confident that "Strawberry" contains three 'r's.
</think>

To determine how many times the letter 'r' appears in the word "Strawberry," we can break down the word letter by letter:

1. S
2. T
3. R (count 1)
4. A
5. W
6. B
7. E
8. R (count 2)
9. R (count 3)
10. Y

By examining each character, we find that the letter 'r' appears three times in "Strawberry."

<answer>\boxed{3}</answer>

Llama.cpp run output

(base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> llama-cli.exe -m .\jp_calibration\DeepSeek-R1-Distill-Qwen-32B-Q5_K_S-jp.gguf -ngl 99
...
== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to the AI.
 - To return control without starting a new line, end your input with '/'.
 - If you want to submit another line, end your input with '\'.
 - Using default system message. To change it, set a different value via -p PROMPT or -f FILE argument.

You are a helpful assistant


> How many r's are in the word Strawberry?
<think>
Okay, so I need to figure out how many 'r's are in the word "Strawberry." Hmm, let me start by spelling it out to make sure I get each letter right. S-T-R-A-W-B-E-R-R-Y. Wait, is that correct? I'm a bit confused because sometimes I mix up the letters in "strawberry." Let me write it down: S-T-R-A-W-B-E-R-R-Y. 

Now, I need to count the 'r's. Let's go through each letter one by one. The first letter is S, then T, then R. Okay, that's one 'r.' Moving on, A, W, B, E... then another R. So that's the second 'r.' After that, there's another R, making it the third 'r.' Wait, does "strawberry" have two or three 'r's? I'm a bit unsure now.

Let me double-check by writing the word again: S-T-R-A-W-B-E-R-R-Y. So breaking it down: S, T, R, A, W, B, E, R, R, Y. Yep, that's three 'r's. The first one comes right after T, then there's another R after E, and another one right after that. So three in total.

I think I initially thought there were two because sometimes the double 'r' at the end can be confusing, but when you break it down, there are actually three 'r's in "strawberry." So the answer should be three.
</think>

The word "Strawberry" contains three 'r's. 

Step-by-step explanation:
1. Spell out the word: S-T-R-A-W-B-E-R-R-Y.
2. Identify each 'r' in the sequence.
3. Count them: R (1st), R (2nd), R (3rd).

Answer: There are 3 'r's in "Strawberry."

>


The word "Strawberry" contains three 'r's.

Step-by-step explanation:
1. Spell out the word: S-T-R-A-W-B-E-R-R-Y.
2. Identify each 'r' in the sequence.
3. Count them: R (1st), R (2nd), R (3rd).

Answer: There are 3 'r's in "Strawberry."
...

Modelfile:

FROM "jp_calibration/DeepSeek-R1-Distill-Qwen-32B-Q5_K_S-jp.gguf"

PARAMETER stop "<|begin▁of▁sentence|>"
PARAMETER stop "<|end▁of▁sentence|>"
PARAMETER stop "<|User|>"
PARAMETER stop "<|Assistant|>"

PARAMETER temperature 0.5
PARAMETER top_k 40
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1.1
PARAMETER repeat_last_n 64

SYSTEM """
The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer.
The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> answer here </answer>
If the user's question is math related, please put your final answer within \\boxed{{}}.
"""

TEMPLATE """
{{- if .System }}{{ .System }}{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1}}
{{- if eq .Role "user" }}<|User|>{{ .Content }}
{{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
{{- end }}
{{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}
{{- end }}
"""

Relevant log output

llama_model_loader: loaded meta data with 31 key-value pairs and 771 tensors from C:\Users\sub01\Server\ollama\models\blobs\sha256-b0777aa14d13b6ab9ea8dda87e948b5ff37f95282c809db38886f0427fb51bb4 (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv   0:                       general.architecture str              = qwen2
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = DeepSeek R1 Distill Qwen 32B
llama_model_loader: - kv   3:                       general.organization str              = Deepseek Ai
llama_model_loader: - kv   4:                           general.basename str              = DeepSeek-R1-Distill-Qwen
llama_model_loader: - kv   5:                         general.size_label str              = 32B
llama_model_loader: - kv   6:                          qwen2.block_count u32              = 64
llama_model_loader: - kv   7:                       qwen2.context_length u32              = 131072
llama_model_loader: - kv   8:                     qwen2.embedding_length u32              = 5120
llama_model_loader: - kv   9:                  qwen2.feed_forward_length u32              = 27648
llama_model_loader: - kv  10:                 qwen2.attention.head_count u32              = 40
llama_model_loader: - kv  11:              qwen2.attention.head_count_kv u32              = 8
llama_model_loader: - kv  12:                       qwen2.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  13:     qwen2.attention.layer_norm_rms_epsilon f32              = 0.000010
llama_model_loader: - kv  14:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  15:                         tokenizer.ggml.pre str              = deepseek-r1-qwen
llama_model_loader: - kv  16:                      tokenizer.ggml.tokens arr[str,152064]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  17:                  tokenizer.ggml.token_type arr[i32,152064]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  18:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  19:                tokenizer.ggml.bos_token_id u32              = 151646
llama_model_loader: - kv  20:                tokenizer.ggml.eos_token_id u32              = 151643
llama_model_loader: - kv  21:            tokenizer.ggml.padding_token_id u32              = 151654
llama_model_loader: - kv  22:               tokenizer.ggml.add_bos_token bool             = true
llama_model_loader: - kv  23:               tokenizer.ggml.add_eos_token bool             = false
llama_model_loader: - kv  24:                    tokenizer.chat_template str              = {% if not add_generation_prompt is de...
llama_model_loader: - kv  25:               general.quantization_version u32              = 2
llama_model_loader: - kv  26:                          general.file_type u32              = 16
llama_model_loader: - kv  27:                      quantize.imatrix.file str              = imatrix.dat
llama_model_loader: - kv  28:                   quantize.imatrix.dataset str              = C:\Users\sub01\Server\Storage\QUANT_I...
llama_model_loader: - kv  29:             quantize.imatrix.entries_count i32              = 448
llama_model_loader: - kv  30:              quantize.imatrix.chunks_count i32              = 727
llama_model_loader: - type  f32:  321 tensors
llama_model_loader: - type q5_K:  449 tensors
llama_model_loader: - type q6_K:    1 tensors
llm_load_vocab: missing or unrecognized pre-tokenizer type, using: 'default'
llm_load_vocab: special_eos_id is not in special_eog_ids - the tokenizer config may be incorrect
llm_load_vocab: special tokens cache size = 22
llm_load_vocab: token to piece cache size = 0.9310 MB
llm_load_print_meta: format           = GGUF V3 (latest)
llm_load_print_meta: arch             = qwen2
llm_load_print_meta: vocab type       = BPE
llm_load_print_meta: n_vocab          = 152064
llm_load_print_meta: n_merges         = 151387
llm_load_print_meta: vocab_only       = 1
llm_load_print_meta: model type       = ?B
llm_load_print_meta: model ftype      = all F32
llm_load_print_meta: model params     = 32.76 B
llm_load_print_meta: model size       = 21.08 GiB (5.53 BPW)
llm_load_print_meta: general.name     = DeepSeek R1 Distill Qwen 32B
llm_load_print_meta: BOS token        = 151646 '<|begin▁of▁sentence|>'
llm_load_print_meta: EOS token        = 151643 '<|end▁of▁sentence|>'
llm_load_print_meta: EOT token        = 151643 '<|end▁of▁sentence|>'
llm_load_print_meta: PAD token        = 151654 '<|vision_pad|>'
llm_load_print_meta: LF token         = 148848 'ÄĬ'
llm_load_print_meta: FIM PRE token    = 151659 '<|fim_prefix|>'
llm_load_print_meta: FIM SUF token    = 151661 '<|fim_suffix|>'
llm_load_print_meta: FIM MID token    = 151660 '<|fim_middle|>'
llm_load_print_meta: FIM PAD token    = 151662 '<|fim_pad|>'
llm_load_print_meta: FIM REP token    = 151663 '<|repo_name|>'
llm_load_print_meta: FIM SEP token    = 151664 '<|file_sep|>'
llm_load_print_meta: EOG token        = 151643 '<|end▁of▁sentence|>'
llm_load_print_meta: EOG token        = 151662 '<|fim_pad|>'
llm_load_print_meta: EOG token        = 151663 '<|repo_name|>'
llm_load_print_meta: EOG token        = 151664 '<|file_sep|>'
llm_load_print_meta: max token length = 256
llama_model_load: vocab only - skipping tensors

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.5.7

Originally created by @Sub0X on GitHub (Feb 9, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8965 ### What is the issue? All reasoning related models after running `ollama create MODEL` has failed to produce <think> in the beginning. When using llama.cpp to run the gguf file via `llama-cli`, it works fine as the <think> tags are there. Relevant reddit post: https://www.reddit.com/r/OpenWebUI/comments/1ik8n2z/reasoning_models_from_huggingface_missing/ ### Ollama run output: ``` (base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> ollama create DeepSeek-R1-Distill-Qwen-32B:q5_K_S gathering model components copying file sha256:b0777aa14d13b6ab9ea8dda87e948b5ff37f95282c809db38886f0427fb51bb4 100% parsing GGUF using existing layer sha256:b0777aa14d13b6ab9ea8dda87e948b5ff37f95282c809db38886f0427fb51bb4 creating new layer sha256:3399a9e3d66a4b9c9a10d64fcf94807ab26fd48d75e38c3900c0423935e7566d creating new layer sha256:14f461e5eadec4c5850470d58b26f138e8e07da88842d58dc134af99558a893a creating new layer sha256:381f8a536fbddb69e1a331f11c40f300fdf44cf427b90408cd807f0141259b4d writing manifest success (base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> ollama run DeepSeek-R1-Distill-Qwen-32B:q5_K_S >>> How many r's are in the word Strawberry? Alright, so I need to figure out how many times the letter 'r' appears in the word "Strawberry." Hmm, okay, let's start by spelling it out and looking at each letter one by one. First, I'll write down the word: S-T-R-A-W-B-E-R-R-Y. Now, I need to go through each character and count whenever an 'r' shows up. Starting from the beginning: 1. S – that's not an 'r'. 2. T – also not. 3. R – here we go, that's one 'r'. 4. A – nope. 5. W – still not. 6. B – moving on. 7. E – almost there. 8. R – another one! That brings the count to two. 9. R – wait, is there another 'r' right after? Yes, so that's three 'r's now. 10. Y – and we're done. Wait a second, did I count correctly? Let me double-check because sometimes it's easy to miscount when letters are close together. So going back through the word: S-T-R-A-W-B-E-R-R-Y. Breaking it down: - The third letter is 'R' (1). - Then after E comes another 'R' (2). - And immediately following that, there's yet another 'R' (3). So yes, I think there are three 'r's in "Strawberry." That seems a bit high, but when you look at the word, it does have two 'r's back to back after the E. So counting each one individually gives us three. I guess sometimes words can have multiple instances of the same letter, especially vowels or consonants that are used repeatedly for pronunciation purposes. In this case, "Strawberry" uses 'r' three times to help with how it sounds when spoken aloud. Another way to confirm is by writing out each position and labeling them: 1. S 2. T 3. R (count 1) 4. A 5. W 6. B 7. E 8. R (count 2) 9. R (count 3) 10. Y Yep, that's three 'r's in total. I don't think there's any chance of missing one because the word isn't too long, and the letters are pretty straightforward once you break them down. So after carefully going through each letter and double-checking my count, I'm confident that "Strawberry" contains three 'r's. </think> To determine how many times the letter 'r' appears in the word "Strawberry," we can break down the word letter by letter: 1. S 2. T 3. R (count 1) 4. A 5. W 6. B 7. E 8. R (count 2) 9. R (count 3) 10. Y By examining each character, we find that the letter 'r' appears three times in "Strawberry." <answer>\boxed{3}</answer> ``` ### Llama.cpp run output ``` (base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> llama-cli.exe -m .\jp_calibration\DeepSeek-R1-Distill-Qwen-32B-Q5_K_S-jp.gguf -ngl 99 ... == Running in interactive mode. == - Press Ctrl+C to interject at any time. - Press Return to return control to the AI. - To return control without starting a new line, end your input with '/'. - If you want to submit another line, end your input with '\'. - Using default system message. To change it, set a different value via -p PROMPT or -f FILE argument. You are a helpful assistant > How many r's are in the word Strawberry? <think> Okay, so I need to figure out how many 'r's are in the word "Strawberry." Hmm, let me start by spelling it out to make sure I get each letter right. S-T-R-A-W-B-E-R-R-Y. Wait, is that correct? I'm a bit confused because sometimes I mix up the letters in "strawberry." Let me write it down: S-T-R-A-W-B-E-R-R-Y. Now, I need to count the 'r's. Let's go through each letter one by one. The first letter is S, then T, then R. Okay, that's one 'r.' Moving on, A, W, B, E... then another R. So that's the second 'r.' After that, there's another R, making it the third 'r.' Wait, does "strawberry" have two or three 'r's? I'm a bit unsure now. Let me double-check by writing the word again: S-T-R-A-W-B-E-R-R-Y. So breaking it down: S, T, R, A, W, B, E, R, R, Y. Yep, that's three 'r's. The first one comes right after T, then there's another R after E, and another one right after that. So three in total. I think I initially thought there were two because sometimes the double 'r' at the end can be confusing, but when you break it down, there are actually three 'r's in "strawberry." So the answer should be three. </think> The word "Strawberry" contains three 'r's. Step-by-step explanation: 1. Spell out the word: S-T-R-A-W-B-E-R-R-Y. 2. Identify each 'r' in the sequence. 3. Count them: R (1st), R (2nd), R (3rd). Answer: There are 3 'r's in "Strawberry." > The word "Strawberry" contains three 'r's. Step-by-step explanation: 1. Spell out the word: S-T-R-A-W-B-E-R-R-Y. 2. Identify each 'r' in the sequence. 3. Count them: R (1st), R (2nd), R (3rd). Answer: There are 3 'r's in "Strawberry." ... ``` ### Modelfile: ``` FROM "jp_calibration/DeepSeek-R1-Distill-Qwen-32B-Q5_K_S-jp.gguf" PARAMETER stop "<|begin▁of▁sentence|>" PARAMETER stop "<|end▁of▁sentence|>" PARAMETER stop "<|User|>" PARAMETER stop "<|Assistant|>" PARAMETER temperature 0.5 PARAMETER top_k 40 PARAMETER top_p 0.95 PARAMETER repeat_penalty 1.1 PARAMETER repeat_last_n 64 SYSTEM """ The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> answer here </answer> If the user's question is math related, please put your final answer within \\boxed{{}}. """ TEMPLATE """ {{- if .System }}{{ .System }}{{ end }} {{- range $i, $_ := .Messages }} {{- $last := eq (len (slice $.Messages $i)) 1}} {{- if eq .Role "user" }}<|User|>{{ .Content }} {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} {{- end }} {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} {{- end }} """ ``` ### Relevant log output ```shell llama_model_loader: loaded meta data with 31 key-value pairs and 771 tensors from C:\Users\sub01\Server\ollama\models\blobs\sha256-b0777aa14d13b6ab9ea8dda87e948b5ff37f95282c809db38886f0427fb51bb4 (version GGUF V3 (latest)) llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output. llama_model_loader: - kv 0: general.architecture str = qwen2 llama_model_loader: - kv 1: general.type str = model llama_model_loader: - kv 2: general.name str = DeepSeek R1 Distill Qwen 32B llama_model_loader: - kv 3: general.organization str = Deepseek Ai llama_model_loader: - kv 4: general.basename str = DeepSeek-R1-Distill-Qwen llama_model_loader: - kv 5: general.size_label str = 32B llama_model_loader: - kv 6: qwen2.block_count u32 = 64 llama_model_loader: - kv 7: qwen2.context_length u32 = 131072 llama_model_loader: - kv 8: qwen2.embedding_length u32 = 5120 llama_model_loader: - kv 9: qwen2.feed_forward_length u32 = 27648 llama_model_loader: - kv 10: qwen2.attention.head_count u32 = 40 llama_model_loader: - kv 11: qwen2.attention.head_count_kv u32 = 8 llama_model_loader: - kv 12: qwen2.rope.freq_base f32 = 1000000.000000 llama_model_loader: - kv 13: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000010 llama_model_loader: - kv 14: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 15: tokenizer.ggml.pre str = deepseek-r1-qwen llama_model_loader: - kv 16: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ... llama_model_loader: - kv 17: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 18: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",... llama_model_loader: - kv 19: tokenizer.ggml.bos_token_id u32 = 151646 llama_model_loader: - kv 20: tokenizer.ggml.eos_token_id u32 = 151643 llama_model_loader: - kv 21: tokenizer.ggml.padding_token_id u32 = 151654 llama_model_loader: - kv 22: tokenizer.ggml.add_bos_token bool = true llama_model_loader: - kv 23: tokenizer.ggml.add_eos_token bool = false llama_model_loader: - kv 24: tokenizer.chat_template str = {% if not add_generation_prompt is de... llama_model_loader: - kv 25: general.quantization_version u32 = 2 llama_model_loader: - kv 26: general.file_type u32 = 16 llama_model_loader: - kv 27: quantize.imatrix.file str = imatrix.dat llama_model_loader: - kv 28: quantize.imatrix.dataset str = C:\Users\sub01\Server\Storage\QUANT_I... llama_model_loader: - kv 29: quantize.imatrix.entries_count i32 = 448 llama_model_loader: - kv 30: quantize.imatrix.chunks_count i32 = 727 llama_model_loader: - type f32: 321 tensors llama_model_loader: - type q5_K: 449 tensors llama_model_loader: - type q6_K: 1 tensors llm_load_vocab: missing or unrecognized pre-tokenizer type, using: 'default' llm_load_vocab: special_eos_id is not in special_eog_ids - the tokenizer config may be incorrect llm_load_vocab: special tokens cache size = 22 llm_load_vocab: token to piece cache size = 0.9310 MB llm_load_print_meta: format = GGUF V3 (latest) llm_load_print_meta: arch = qwen2 llm_load_print_meta: vocab type = BPE llm_load_print_meta: n_vocab = 152064 llm_load_print_meta: n_merges = 151387 llm_load_print_meta: vocab_only = 1 llm_load_print_meta: model type = ?B llm_load_print_meta: model ftype = all F32 llm_load_print_meta: model params = 32.76 B llm_load_print_meta: model size = 21.08 GiB (5.53 BPW) llm_load_print_meta: general.name = DeepSeek R1 Distill Qwen 32B llm_load_print_meta: BOS token = 151646 '<|begin▁of▁sentence|>' llm_load_print_meta: EOS token = 151643 '<|end▁of▁sentence|>' llm_load_print_meta: EOT token = 151643 '<|end▁of▁sentence|>' llm_load_print_meta: PAD token = 151654 '<|vision_pad|>' llm_load_print_meta: LF token = 148848 'ÄĬ' llm_load_print_meta: FIM PRE token = 151659 '<|fim_prefix|>' llm_load_print_meta: FIM SUF token = 151661 '<|fim_suffix|>' llm_load_print_meta: FIM MID token = 151660 '<|fim_middle|>' llm_load_print_meta: FIM PAD token = 151662 '<|fim_pad|>' llm_load_print_meta: FIM REP token = 151663 '<|repo_name|>' llm_load_print_meta: FIM SEP token = 151664 '<|file_sep|>' llm_load_print_meta: EOG token = 151643 '<|end▁of▁sentence|>' llm_load_print_meta: EOG token = 151662 '<|fim_pad|>' llm_load_print_meta: EOG token = 151663 '<|repo_name|>' llm_load_print_meta: EOG token = 151664 '<|file_sep|>' llm_load_print_meta: max token length = 256 llama_model_load: vocab only - skipping tensors ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.5.7
GiteaMirror added the bug label 2026-04-22 12:09:24 -05:00
Author
Owner

@YonTracks commented on GitHub (Feb 9, 2025):

try with env setting OLLAMA_NOPRUNE:false it does something, not sure.
worth a try.

<!-- gh-comment-id:2646105160 --> @YonTracks commented on GitHub (Feb 9, 2025): try with env setting `OLLAMA_NOPRUNE:false` it does something, not sure. worth a try.
Author
Owner

@Sub0X commented on GitHub (Feb 9, 2025):

try with env setting OLLAMA_NOPRUNE:false it does something, not sure. worth a try.

Unfortunately, it seems like settting that environmental variable has no effect on the output:

Image

(base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> ollama run DeepSeek-R1-Distill-Qwen-32B:q5_K_S
>>> How many r's are in the word Strawberry?
Alright, let me figure out how to answer this question. The user wants to know how many times the letter 'r' appears in the word "Strawberry." Okay, so first, I should probably write down the word and then go through
each letter one by one to count the 'r's.

So, spelling it out: S-T-R-A-W-B-E-R-R-Y. Wait, is that correct? Let me double-check because sometimes people might miss letters or add extra ones. No, "Strawberry" should have two 'r's. But let me confirm by writing
each letter:

S - no
T - no
R - yes (1)
A - no
W - no
B - no
E - no
R - yes (2)
R - yes (3)
Y - no

Wait, hold on, that doesn't seem right. I thought "Strawberry" has two 'r's, but when I spelled it out, I ended up with three? Hmm, maybe I made a mistake in the spelling.

Let me try again more carefully. The word is S-T-R-A-W-B-E-R-R-Y. Breaking it down:

1. S
2. T
3. R (first 'r')
4. A
5. W
6. B
7. E
8. R (second 'r')
9. R (third 'r')? Wait, that can't be right because I think "Strawberry" only has two 'r's.

Wait a second, maybe I'm adding an extra 'r' by mistake. Let me look it up to make sure I have the correct spelling. Oh no, actually, "Strawberry" is spelled S-T-R-A-W-B-E-R-R-Y, which does include three 'r's? Or am I        
confusing it with another word?

Wait, perhaps not. Maybe it's only two 'r's. Let me count again: after E comes R (second), then another R (third), and then Y. So that would make three 'r's. But now I'm confused because I thought there were only two.

Maybe my initial assumption was wrong. To be accurate, perhaps I should write it out letter by letter:

1. S
2. T
3. R (1)
4. A
5. W
6. B
7. E
8. R (2)
9. R (3)
10. Y

So that's three 'r's? But I'm pretty sure "Strawberry" has two 'r's. Maybe I'm overcomplicating this.

Alternatively, maybe the correct spelling is S-T-R-A-W-B-E-R-Y, which would only have two 'r's. Let me check a dictionary or something. Since I can't access external resources, I'll rely on my memory.

Wait, no, "Strawberry" does have two 'r's: one after T and another before the final Y. So it should be S-T-R-A-W-B-E-R-Y. Therefore, only two 'r's.

So going back to the initial breakdown:

1. S
2. T
3. R (1)
4. A
5. W
6. B
7. E
8. R (2)
9. Y

Ah, that makes sense. So there are two 'r's in "Strawberry." I think I added an extra 'r' earlier by mistake.

So the correct count is two.
</think>

<answer>There are \boxed{2} r's in the word Strawberry.</answer>
<!-- gh-comment-id:2646107893 --> @Sub0X commented on GitHub (Feb 9, 2025): > try with env setting `OLLAMA_NOPRUNE:false` it does something, not sure. worth a try. Unfortunately, it seems like settting that environmental variable has no effect on the output: ![Image](https://github.com/user-attachments/assets/07ffd52b-414f-4075-b11a-f237c72d175e) ``` (base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> ollama run DeepSeek-R1-Distill-Qwen-32B:q5_K_S >>> How many r's are in the word Strawberry? Alright, let me figure out how to answer this question. The user wants to know how many times the letter 'r' appears in the word "Strawberry." Okay, so first, I should probably write down the word and then go through each letter one by one to count the 'r's. So, spelling it out: S-T-R-A-W-B-E-R-R-Y. Wait, is that correct? Let me double-check because sometimes people might miss letters or add extra ones. No, "Strawberry" should have two 'r's. But let me confirm by writing each letter: S - no T - no R - yes (1) A - no W - no B - no E - no R - yes (2) R - yes (3) Y - no Wait, hold on, that doesn't seem right. I thought "Strawberry" has two 'r's, but when I spelled it out, I ended up with three? Hmm, maybe I made a mistake in the spelling. Let me try again more carefully. The word is S-T-R-A-W-B-E-R-R-Y. Breaking it down: 1. S 2. T 3. R (first 'r') 4. A 5. W 6. B 7. E 8. R (second 'r') 9. R (third 'r')? Wait, that can't be right because I think "Strawberry" only has two 'r's. Wait a second, maybe I'm adding an extra 'r' by mistake. Let me look it up to make sure I have the correct spelling. Oh no, actually, "Strawberry" is spelled S-T-R-A-W-B-E-R-R-Y, which does include three 'r's? Or am I confusing it with another word? Wait, perhaps not. Maybe it's only two 'r's. Let me count again: after E comes R (second), then another R (third), and then Y. So that would make three 'r's. But now I'm confused because I thought there were only two. Maybe my initial assumption was wrong. To be accurate, perhaps I should write it out letter by letter: 1. S 2. T 3. R (1) 4. A 5. W 6. B 7. E 8. R (2) 9. R (3) 10. Y So that's three 'r's? But I'm pretty sure "Strawberry" has two 'r's. Maybe I'm overcomplicating this. Alternatively, maybe the correct spelling is S-T-R-A-W-B-E-R-Y, which would only have two 'r's. Let me check a dictionary or something. Since I can't access external resources, I'll rely on my memory. Wait, no, "Strawberry" does have two 'r's: one after T and another before the final Y. So it should be S-T-R-A-W-B-E-R-Y. Therefore, only two 'r's. So going back to the initial breakdown: 1. S 2. T 3. R (1) 4. A 5. W 6. B 7. E 8. R (2) 9. Y Ah, that makes sense. So there are two 'r's in "Strawberry." I think I added an extra 'r' earlier by mistake. So the correct count is two. </think> <answer>There are \boxed{2} r's in the word Strawberry.</answer> ```
Author
Owner

@YonTracks commented on GitHub (Feb 9, 2025):

to be clear, I meant env change, then restart the server, then create the model?
edit^:
interesting, so no change at all?

So the correct count is two.
</think>

<answer>There are \boxed{2} r's in the word Strawberry.</answer>

only the end has the correct tag?

earlier deepseek had similar.
good luck

<!-- gh-comment-id:2646109039 --> @YonTracks commented on GitHub (Feb 9, 2025): to be clear, I meant env change, then restart the server, then create the model? edit^: interesting, so no change at all? ``` So the correct count is two. </think> <answer>There are \boxed{2} r's in the word Strawberry.</answer> ``` only the end has the correct tag? earlier deepseek had similar. good luck
Author
Owner

@Sub0X commented on GitHub (Feb 9, 2025):

to be clear, I meant env change, then restart the server, then create the model? edit^: interesting, so no change at all?

So the correct count is two.
</think>

<answer>There are \boxed{2} r's in the word Strawberry.</answer>

only the end has the correct tag?

earlier deepseek had similar. good luck

Yep! Thats what I did but to no avail

<!-- gh-comment-id:2646113407 --> @Sub0X commented on GitHub (Feb 9, 2025): > to be clear, I meant env change, then restart the server, then create the model? edit^: interesting, so no change at all? > > ``` > So the correct count is two. > </think> > > <answer>There are \boxed{2} r's in the word Strawberry.</answer> > ``` > > only the end has the correct tag? > > earlier deepseek had similar. good luck Yep! Thats what I did but to no avail
Author
Owner

@rick-github commented on GitHub (Feb 9, 2025):

The special tokens are incorrect. Deepseek doesn't use "<|User|>", it uses "<|User|>", where the vertical bar is unicode character full width vertical line, not the ASCII vertical bar.

5,6c5,6
< PARAMETER stop "<|User|>"
< PARAMETER stop "<|Assistant|>"
---
> PARAMETER stop "<|User|>"
> PARAMETER stop "<|Assistant|>"
24,25c24,25
< {{- if eq .Role "user" }}<|User|>{{ .Content }}
< {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
---
> {{- if eq .Role "user" }}<|User|>{{ .Content }}
> {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
27c27
< {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}
---
> {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}
<!-- gh-comment-id:2646142731 --> @rick-github commented on GitHub (Feb 9, 2025): The special tokens are incorrect. Deepseek doesn't use "<|User|>", it uses "<|User|>", where the vertical bar is unicode character [full width vertical line](https://codepoints.net/U+FF5C?lang=en), not the ASCII [vertical bar](https://en.wikipedia.org/wiki/Vertical_bar). ```diff 5,6c5,6 < PARAMETER stop "<|User|>" < PARAMETER stop "<|Assistant|>" --- > PARAMETER stop "<|User|>" > PARAMETER stop "<|Assistant|>" 24,25c24,25 < {{- if eq .Role "user" }}<|User|>{{ .Content }} < {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} --- > {{- if eq .Role "user" }}<|User|>{{ .Content }} > {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} 27c27 < {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} --- > {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} ```
Author
Owner

@Sub0X commented on GitHub (Feb 9, 2025):

The special tokens are incorrect. Deepseek doesn't use "<|User|>", it uses "<|User|>", where the vertical bar is unicode character full width vertical line, not the ASCII vertical bar.

5,6c5,6
< PARAMETER stop "<|User|>"
< PARAMETER stop "<|Assistant|>"

PARAMETER stop "<|User|>"
PARAMETER stop "<|Assistant|>"
24,25c24,25
< {{- if eq .Role "user" }}<|User|>{{ .Content }}
< {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}


{{- if eq .Role "user" }}<|User|>{{ .Content }}
{{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
27c27
< {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}


{{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}

Thanks for the catch! I've just updated the modelfile but as expected, the issue still persists:

Updated Modelfile

FROM "jp_calibration/DeepSeek-R1-Distill-Qwen-32B-Q5_K_S-jp.gguf"

PARAMETER stop "<|begin▁of▁sentence|>"
PARAMETER stop "<|end▁of▁sentence|>"
PARAMETER stop "<|User|>"
PARAMETER stop "<|Assistant|>"


PARAMETER temperature 0.5
PARAMETER top_k 40
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1.1
PARAMETER repeat_last_n 64

SYSTEM """
The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer.
The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> answer here </answer>
If the user's question is math related, please put your final answer within \\boxed{{}}.
"""

TEMPLATE """
{{- if .System }}{{ .System }}{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1}}
{{- if eq .Role "user" }}<|User|>{{ .Content }}
{{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
{{- end }}
{{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}
{{- end }}
"""

Output

(base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> ollama run DeepSeek-R1-Distill-Qwen-32B:q5_K_S
>>> How many r's are in the word Strawberry?
Okay, so I need to figure out how many times the letter 'r' appears in the word "Strawberry." Let me start by writing down the word and
then looking at each letter individually.

The word is S-T-R-A-W-B-E-R-R-Y. Now, let's break it down letter by letter:

1. S
2. T
3. R
4. A
5. W
6. B
7. E
8. R
9. R
10. Y

Wait a minute, that doesn't seem right. When I spell "Strawberry," it should have two 'r's, not three. Maybe I miscounted the letters or
added an extra one somewhere.

Let me try again by writing out each letter carefully:

S-T-R-A-W-B-E-R-R-Y. Hmm, starting from S, then T, R, A, W, B, E, and then two R's before Y. So that would be three 'r's? But I thought
it was only two.

Wait, no, actually, in the word "Strawberry," after the E comes two R's: so E-R-R-Y. That makes two 'r's at the end. Let me count again:

1. S
2. T
3. R (first r)
4. A
5. W
6. B
7. E
8. R (second r)
9. Y

Wait, that's only two 'r's. So maybe I was confused before when I thought there were three.

Alternatively, perhaps the word is spelled with an extra R somewhere else? Let me check: S-T-R-A-W-B-E-R-R-Y. No, that seems
correct—only two 'r's at positions 3 and 8-9 (as in double r). So total of two 'r's.

But wait, when I write it out as letters, after E comes R, then another R before Y. So that's two 'r's: one after T, and then two more
at the end? No, no—after E is R-R-Y, which is two Rs. But earlier there was an R at position 3.

So in total, it's three 'r's? S-T-R-A-W-B-E-R-R-Y: that would be positions 3, 8, and 9 as R's. Wait, but the word "Strawberry" doesn't
have three Rs. Let me think again.

Actually, when I write it out correctly: S-T-R-A-W-B-E-R-R-Y. So after E comes two R's before Y. That makes two 'r's at positions 8 and
9. But earlier, there was an R at position 3. So that would be three Rs in total.

Wait, but I'm getting confused because sometimes people might spell it without the double R. Let me think about how it's pronounced.
"Straw-berry" has a single R sound after the B. Wait, no—it's "straw-berry," which is spelled with two R's at the end: E-R-R-Y.

So in that case, the word has an R at position 3 and then two more Rs at positions 8 and 9. So that would be three 'r's. But when I
think of the pronunciation, it doesn't sound like there are three separate R sounds—it's more like one R sound after E.

Hmm, maybe I'm overcomplicating this. Let me just write out each letter with their positions:

1. S
2. T
3. R
4. A
5. W
6. B
7. E
8. R
9. R
10. Y

So that's three 'r's: at positions 3, 8, and 9. Therefore, the word "Strawberry" has three Rs.

Wait, but I'm not sure if that's correct because sometimes people might spell it with only one R after E. Let me double-check by looking
up the spelling of "strawberry."

Upon checking, "strawberry" is indeed spelled S-T-R-A-W-B-E-R-R-Y, which includes two Rs at the end. So in total, there are three Rs:
one early on and then two more at the end.
</think>

The word "Strawberry" is spelled as S-T-R-A-W-B-E-R-R-Y. Let's break it down letter by letter:

1. S
2. T
3. R
4. A
5. W
6. B
7. E
8. R
9. R
10. Y

Counting the 'r's, we find them at positions 3, 8, and 9. Therefore, there are three 'r's in total.

<answer>There are \boxed{3} r's in the word Strawberry.</answer>
<!-- gh-comment-id:2646158160 --> @Sub0X commented on GitHub (Feb 9, 2025): > The special tokens are incorrect. Deepseek doesn't use "<|User|>", it uses "<|User|>", where the vertical bar is unicode character [full width vertical line](https://codepoints.net/U+FF5C?lang=en), not the ASCII [vertical bar](https://en.wikipedia.org/wiki/Vertical_bar). > > 5,6c5,6 > < PARAMETER stop "<|User|>" > < PARAMETER stop "<|Assistant|>" > --- > > PARAMETER stop "<|User|>" > > PARAMETER stop "<|Assistant|>" > 24,25c24,25 > < {{- if eq .Role "user" }}<|User|>{{ .Content }} > < {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} > --- > > {{- if eq .Role "user" }}<|User|>{{ .Content }} > > {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} > 27c27 > < {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} > --- > > {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} Thanks for the catch! I've just updated the modelfile but as expected, the issue still persists: ### Updated Modelfile ``` FROM "jp_calibration/DeepSeek-R1-Distill-Qwen-32B-Q5_K_S-jp.gguf" PARAMETER stop "<|begin▁of▁sentence|>" PARAMETER stop "<|end▁of▁sentence|>" PARAMETER stop "<|User|>" PARAMETER stop "<|Assistant|>" PARAMETER temperature 0.5 PARAMETER top_k 40 PARAMETER top_p 0.95 PARAMETER repeat_penalty 1.1 PARAMETER repeat_last_n 64 SYSTEM """ The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> answer here </answer> If the user's question is math related, please put your final answer within \\boxed{{}}. """ TEMPLATE """ {{- if .System }}{{ .System }}{{ end }} {{- range $i, $_ := .Messages }} {{- $last := eq (len (slice $.Messages $i)) 1}} {{- if eq .Role "user" }}<|User|>{{ .Content }} {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} {{- end }} {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} {{- end }} """ ``` ### Output ``` (base) PS C:\Users\sub01\Server\Storage\DeepSeek-R1-Distill-Qwen-32B> ollama run DeepSeek-R1-Distill-Qwen-32B:q5_K_S >>> How many r's are in the word Strawberry? Okay, so I need to figure out how many times the letter 'r' appears in the word "Strawberry." Let me start by writing down the word and then looking at each letter individually. The word is S-T-R-A-W-B-E-R-R-Y. Now, let's break it down letter by letter: 1. S 2. T 3. R 4. A 5. W 6. B 7. E 8. R 9. R 10. Y Wait a minute, that doesn't seem right. When I spell "Strawberry," it should have two 'r's, not three. Maybe I miscounted the letters or added an extra one somewhere. Let me try again by writing out each letter carefully: S-T-R-A-W-B-E-R-R-Y. Hmm, starting from S, then T, R, A, W, B, E, and then two R's before Y. So that would be three 'r's? But I thought it was only two. Wait, no, actually, in the word "Strawberry," after the E comes two R's: so E-R-R-Y. That makes two 'r's at the end. Let me count again: 1. S 2. T 3. R (first r) 4. A 5. W 6. B 7. E 8. R (second r) 9. Y Wait, that's only two 'r's. So maybe I was confused before when I thought there were three. Alternatively, perhaps the word is spelled with an extra R somewhere else? Let me check: S-T-R-A-W-B-E-R-R-Y. No, that seems correct—only two 'r's at positions 3 and 8-9 (as in double r). So total of two 'r's. But wait, when I write it out as letters, after E comes R, then another R before Y. So that's two 'r's: one after T, and then two more at the end? No, no—after E is R-R-Y, which is two Rs. But earlier there was an R at position 3. So in total, it's three 'r's? S-T-R-A-W-B-E-R-R-Y: that would be positions 3, 8, and 9 as R's. Wait, but the word "Strawberry" doesn't have three Rs. Let me think again. Actually, when I write it out correctly: S-T-R-A-W-B-E-R-R-Y. So after E comes two R's before Y. That makes two 'r's at positions 8 and 9. But earlier, there was an R at position 3. So that would be three Rs in total. Wait, but I'm getting confused because sometimes people might spell it without the double R. Let me think about how it's pronounced. "Straw-berry" has a single R sound after the B. Wait, no—it's "straw-berry," which is spelled with two R's at the end: E-R-R-Y. So in that case, the word has an R at position 3 and then two more Rs at positions 8 and 9. So that would be three 'r's. But when I think of the pronunciation, it doesn't sound like there are three separate R sounds—it's more like one R sound after E. Hmm, maybe I'm overcomplicating this. Let me just write out each letter with their positions: 1. S 2. T 3. R 4. A 5. W 6. B 7. E 8. R 9. R 10. Y So that's three 'r's: at positions 3, 8, and 9. Therefore, the word "Strawberry" has three Rs. Wait, but I'm not sure if that's correct because sometimes people might spell it with only one R after E. Let me double-check by looking up the spelling of "strawberry." Upon checking, "strawberry" is indeed spelled S-T-R-A-W-B-E-R-R-Y, which includes two Rs at the end. So in total, there are three Rs: one early on and then two more at the end. </think> The word "Strawberry" is spelled as S-T-R-A-W-B-E-R-R-Y. Let's break it down letter by letter: 1. S 2. T 3. R 4. A 5. W 6. B 7. E 8. R 9. R 10. Y Counting the 'r's, we find them at positions 3, 8, and 9. Therefore, there are three 'r's in total. <answer>There are \boxed{3} r's in the word Strawberry.</answer> ```
Author
Owner

@rick-github commented on GitHub (Feb 9, 2025):

The prompt is adding a trailing newline. Change the last {{- end }} to {{- end -}}

<!-- gh-comment-id:2646160042 --> @rick-github commented on GitHub (Feb 9, 2025): The prompt is adding a trailing newline. Change the last `{{- end }}` to `{{- end -}}`
Author
Owner

@Sub0X commented on GitHub (Feb 9, 2025):

Thank you so much!
It is a template problem afterall since now it finally started outputting !

FROM "jp_calibration/DeepSeek-R1-Distill-Qwen-32B-Q5_K_S-jp.gguf"

PARAMETER stop "<|begin▁of▁sentence|>"
PARAMETER stop "<|end▁of▁sentence|>"
PARAMETER stop "<|User|>"
PARAMETER stop "<|Assistant|>"


PARAMETER temperature 0.5
PARAMETER top_k 40
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1.1
PARAMETER repeat_last_n 64

SYSTEM """
The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer.
The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> answer here </answer>
If the user's question is math related, please put your final answer within \\boxed{{}}.
"""

TEMPLATE """
{{- if .System }}{{ .System }}{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1}}
{{- if eq .Role "user" }}<|User|>{{ .Content }}
{{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
{{- end }}
{{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}
{{- end -}}
"""
<!-- gh-comment-id:2646164055 --> @Sub0X commented on GitHub (Feb 9, 2025): Thank you so much! It is a template problem afterall since now it finally started outputting <think>! ``` FROM "jp_calibration/DeepSeek-R1-Distill-Qwen-32B-Q5_K_S-jp.gguf" PARAMETER stop "<|begin▁of▁sentence|>" PARAMETER stop "<|end▁of▁sentence|>" PARAMETER stop "<|User|>" PARAMETER stop "<|Assistant|>" PARAMETER temperature 0.5 PARAMETER top_k 40 PARAMETER top_p 0.95 PARAMETER repeat_penalty 1.1 PARAMETER repeat_last_n 64 SYSTEM """ The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> answer here </answer> If the user's question is math related, please put your final answer within \\boxed{{}}. """ TEMPLATE """ {{- if .System }}{{ .System }}{{ end }} {{- range $i, $_ := .Messages }} {{- $last := eq (len (slice $.Messages $i)) 1}} {{- if eq .Role "user" }}<|User|>{{ .Content }} {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} {{- end }} {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} {{- end -}} """ ```
Author
Owner

@ioveeagle commented on GitHub (Feb 12, 2025):

The prompt is adding a trailing newline. Change the last {{- end }} to {{- end -}}

Much better! thx for sharing
But some question model don't "think", even generate \n\n, is that normal?
I did not set any system prompt in the Modelfile, should I?

Image

<!-- gh-comment-id:2652970568 --> @ioveeagle commented on GitHub (Feb 12, 2025): > The prompt is adding a trailing newline. Change the last `{{- end }}` to `{{- end -}}` Much better! thx for sharing But some question model don't "think", even generate <think>\n\n</think>, is that normal? I did not set any system prompt in the Modelfile, should I? ![Image](https://github.com/user-attachments/assets/dbf7ee50-2ac7-4b89-84dc-fe573a265a5d)
Author
Owner

@rick-github commented on GitHub (Feb 12, 2025):

But some question model don't "think", even generate \n\n, is that normal?

Yes.

<!-- gh-comment-id:2653272374 --> @rick-github commented on GitHub (Feb 12, 2025): > But some question model don't "think", even generate \n\n, is that normal? Yes.
Author
Owner

@sunisstar commented on GitHub (Apr 10, 2025):

The prompt is adding a trailing newline. Change the last to {{- end }}``{{- end -}}

@rick-github qwq-32b also has the same problem, shall I change the last {{- end }}to{{- end -}}` ?

<!-- gh-comment-id:2794882738 --> @sunisstar commented on GitHub (Apr 10, 2025): > The prompt is adding a trailing newline. Change the last to `{{- end }}``{{- end -}}` @rick-github qwq-32b also has the same problem, shall I change the last {{- end }}` to `{{- end -}}` ?
Author
Owner

@rick-github commented on GitHub (Apr 11, 2025):

Where did you get the model from? What's the output of

ollama show --modelfile qwq-32b
<!-- gh-comment-id:2796893043 --> @rick-github commented on GitHub (Apr 11, 2025): Where did you get the model from? What's the output of ``` ollama show --modelfile qwq-32b ```
Author
Owner

@sunisstar commented on GitHub (Apr 22, 2025):

I have tried several versions, including the official ollama version (ollama pull qwq), gguf Q4_K_M on Huggingface, and the modified version by unsloth. However, all of them have the issue of losing tags, especially the latter tags, with an approximate loss rate of 60%.

ollama show qwq-32b
Model
architecture qwen2
parameters 32.8B
context length 131072
embedding length 5120
quantization Q4_K_M

Parameters
temperature 0.6
top_k 40
top_p 0.95
min_p 0
repeat_penalty 1
stop "<|im_start|>"
stop "<|im_end|>"
Currently, this is the version by unsloth, which has a slightly lower loss rate, but it still exceeds half.

<!-- gh-comment-id:2820626047 --> @sunisstar commented on GitHub (Apr 22, 2025): I have tried several versions, including the official ollama version (ollama pull qwq), gguf Q4_K_M on Huggingface, and the modified version by unsloth. However, all of them have the issue of losing <think> tags, especially the latter tags, with an approximate loss rate of 60%. ollama show qwq-32b Model architecture qwen2 parameters 32.8B context length 131072 embedding length 5120 quantization Q4_K_M Parameters temperature 0.6 top_k 40 top_p 0.95 min_p 0 repeat_penalty 1 stop "<|im_start|>" stop "<|im_end|>" Currently, this is the version by unsloth, which has a slightly lower loss rate, but it still exceeds half.
Author
Owner

@sunisstar commented on GitHub (Apr 23, 2025):

ollama show --modelfile qwq-32b

# Modelfile generated by "ollama show"
# To build a new Modelfile based on this, replace FROM with:
# FROM qwq-32b:latest

FROM /data/models/blobs/sha256-524a6c9b91ec47b0b1279f6e06884111c74e822c56c919cfd7769227abed93cd
TEMPLATE """{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}

# Tools

You may call one or more functions to assist with the user query.

You are provided with function signatures within <tools></tools> XML tags:
<tools>
{{- range .Tools }}
{"type": "function", "function": {{ .Function }}}
{{- end }}
</tools>

For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
{{- end }}<|im_end|>
{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{ else if eq .Role "assistant" }}<|im_start|>assistant
{{ if .Content }}{{ .Content }}
{{- else if .ToolCalls }}<tool_call>
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{ end }}</tool_call>
{{- end }}{{ if not $last }}<|im_end|>
{{ end }}
{{- else if eq .Role "tool" }}<|im_start|>user
<tool_response>
{{ .Content }}
</tool_response><|im_end|>
{{ end }}
{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
{{ end }}
{{- end }}
"""
PARAMETER top_p 0.95
PARAMETER min_p 0
PARAMETER repeat_penalty 1
PARAMETER stop <|im_start|>
PARAMETER stop <|im_end|>
PARAMETER temperature 0.6
PARAMETER top_k 40
<!-- gh-comment-id:2823487603 --> @sunisstar commented on GitHub (Apr 23, 2025): ollama show --modelfile qwq-32b ``` # Modelfile generated by "ollama show" # To build a new Modelfile based on this, replace FROM with: # FROM qwq-32b:latest FROM /data/models/blobs/sha256-524a6c9b91ec47b0b1279f6e06884111c74e822c56c919cfd7769227abed93cd TEMPLATE """{{- if or .System .Tools }}<|im_start|>system {{- if .System }} {{ .System }} {{- end }} {{- if .Tools }} # Tools You may call one or more functions to assist with the user query. You are provided with function signatures within <tools></tools> XML tags: <tools> {{- range .Tools }} {"type": "function", "function": {{ .Function }}} {{- end }} </tools> For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags: <tool_call> {"name": <function-name>, "arguments": <args-json-object>} </tool_call> {{- end }}<|im_end|> {{ end }} {{- range $i, $_ := .Messages }} {{- $last := eq (len (slice $.Messages $i)) 1 -}} {{- if eq .Role "user" }}<|im_start|>user {{ .Content }}<|im_end|> {{ else if eq .Role "assistant" }}<|im_start|>assistant {{ if .Content }}{{ .Content }} {{- else if .ToolCalls }}<tool_call> {{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}} {{ end }}</tool_call> {{- end }}{{ if not $last }}<|im_end|> {{ end }} {{- else if eq .Role "tool" }}<|im_start|>user <tool_response> {{ .Content }} </tool_response><|im_end|> {{ end }} {{- if and (ne .Role "assistant") $last }}<|im_start|>assistant {{ end }} {{- end }} """ PARAMETER top_p 0.95 PARAMETER min_p 0 PARAMETER repeat_penalty 1 PARAMETER stop <|im_start|> PARAMETER stop <|im_end|> PARAMETER temperature 0.6 PARAMETER top_k 40 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#31578