[GH-ISSUE #549] Models sometimes prompt themselves #253

Closed
opened 2026-04-12 09:46:42 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @txstc55 on GitHub (Sep 18, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/549

I'm using uncensored model, the issue happened with uncensored-latest, uncensored 70b and any other uncensored model. Sometimes when I prompt the model, after it made a response, it will prompt itself with something like:

### Input:
something that generated by the model itself

### Response:
something that is a response to the input

This happens randomly and sometimes the ### Input tag becomes ### human tag
Any idea why this happens?

Originally created by @txstc55 on GitHub (Sep 18, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/549 I'm using uncensored model, the issue happened with uncensored-latest, uncensored 70b and any other uncensored model. Sometimes when I prompt the model, after it made a response, it will prompt itself with something like: ``` ### Input: something that generated by the model itself ### Response: something that is a response to the input ``` This happens randomly and sometimes the ### Input tag becomes ### human tag Any idea why this happens?
Author
Owner

@BruceMacD commented on GitHub (Sep 18, 2023):

It looks like there could be stop words missing from the default llama2-uncensored modelfile, these tell the LLM when to stop generating more text.

As a workaround until this gets fixed you can create your own llama2-uncensored Modelfile with the correct stop words. Here is how you do that:

  1. Create the Modelfile.
FROM llama2-uncensored:latest
TEMPLATE """### HUMAN:
{{ .Prompt }}

### RESPONSE:
"""
PARAMETER stop "### Input:"
PARAMETER stop "### Response:"
PARAMETER stop "### human"
  1. Load the custom model into Ollama via the CLI:
$ ollama create llama2-uncensored:custom -f path/to/Modelfile
  1. Now you can run it and the generation should stop when stop patterns are detected.
$ ollama run llama2-uncensored:custom
>>> hello
Hello back!
<!-- gh-comment-id:1723620641 --> @BruceMacD commented on GitHub (Sep 18, 2023): It looks like there could be `stop` words missing from the default llama2-uncensored modelfile, these tell the LLM when to stop generating more text. As a workaround until this gets fixed you can create your own llama2-uncensored Modelfile with the correct stop words. Here is how you do that: 1. Create the Modelfile. ``` FROM llama2-uncensored:latest TEMPLATE """### HUMAN: {{ .Prompt }} ### RESPONSE: """ PARAMETER stop "### Input:" PARAMETER stop "### Response:" PARAMETER stop "### human" ``` 2. Load the custom model into Ollama via the CLI: ``` $ ollama create llama2-uncensored:custom -f path/to/Modelfile ``` 3. Now you can run it and the generation should stop when stop patterns are detected. ``` $ ollama run llama2-uncensored:custom >>> hello Hello back! ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#253