[GH-ISSUE #9044] Ollama create a conversation instead of response input #5886

Closed
opened 2026-04-12 17:13:17 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Deep00000 on GitHub (Feb 12, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9044

What is the issue?

I finetuned Mistral-7B-instruct model with multi-turn conversations.I apply the llama2 chat template for test it work pretty well,the template like this:

<s>[INST]<<SYS>>
You are a helpful assistant
<</SYS>>
hi [/INST] Hello.</s>

I set the og chat template to llama2 and convert it to gguf and write a modelfile with:

TEMPLATE """<s>[INST] <<SYS>>{{.System}}<</SYS>>
{{.Prompt}}
[/INST]
{{.Response}}</s>"""

PARAMETER stop <s>[INST]
PARAMETER stop [/INST]
PARAMETER stop <<SYS>>
PARAMETER stop <</SYS>>
PARAMETER stop </s>

It start create a conversation instead of response my input:

>>>Hi
<s> Question: Why don't you talk much?:%.* I'm shy... I often feel like people are just being polite to me.

pls help,thanks,also sorry for my bad English.

Relevant log output


OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.5.4

Originally created by @Deep00000 on GitHub (Feb 12, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9044 ### What is the issue? I finetuned Mistral-7B-instruct model with multi-turn conversations.I apply the llama2 chat template for test it work pretty well,the template like this: `<s>[INST]<<SYS>>` `You are a helpful assistant` `<</SYS>>` `hi [/INST] Hello.</s> ` I set the og chat template to llama2 and convert it to gguf and write a modelfile with: `TEMPLATE """<s>[INST] <<SYS>>{{.System}}<</SYS>>` `{{.Prompt}}` `[/INST]` `{{.Response}}</s>"""` `PARAMETER stop <s>[INST]` `PARAMETER stop [/INST]` `PARAMETER stop <<SYS>>` `PARAMETER stop <</SYS>>` `PARAMETER stop </s>` It start create a conversation instead of response my input: `>>>Hi` `<s> Question: Why don't you talk much?:%.* I'm shy... I often feel like people are just being polite to me.` pls help,thanks,also sorry for my bad English. ### Relevant log output ```shell ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.5.4
GiteaMirror added the bug label 2026-04-12 17:13:17 -05:00
Author
Owner

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

For new models, I'd suggest using Messages rather than Prompt and Response. Messages provides more control over the template structure. You can find an example for Mistral here or Llama 2 here

<!-- gh-comment-id:2654394517 --> @mxyng commented on GitHub (Feb 12, 2025): For new models, I'd suggest using `Messages` rather than `Prompt` and `Response`. `Messages` provides more control over the template structure. You can find an example for Mistral [here](https://github.com/ollama/ollama/blob/main/template/mistral-instruct.gotmpl) or Llama 2 [here](https://github.com/ollama/ollama/blob/main/template/llama2-chat.gotmpl)
Author
Owner

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

@mxyng Thank you bro,it working.

<!-- gh-comment-id:2654502526 --> @Deep00000 commented on GitHub (Feb 12, 2025): @mxyng Thank you bro,it working.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5886