[GH-ISSUE #4054] llama-3-chinese-8b-instruct model infinite loop generate & cannot stop #64554

Closed
opened 2026-05-03 18:07:07 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @gavinliu on GitHub (Apr 30, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4054

What is the issue?

Hey, I found an issue of infinite generation that cannot be stopped, when deploying a Chinese fine-tuned model of llama3

How to solve this problem?

Modelfile file:

FROM /llama-3-chinese-8b-instruct/ggml-model-q8_0.gguf
TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|>

{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>

{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>

{{ .Response }}<|eot_id|>"""
SYSTEM """"""
PARAMETER num_keep 24
PARAMETER stop <|start_header_id|>
PARAMETER stop <|end_header_id|>
PARAMETER stop <|eot_id|>
PARAMETER stop assistant

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.1.32

Originally created by @gavinliu on GitHub (Apr 30, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4054 ### What is the issue? Hey, I found an issue of infinite generation that cannot be stopped, when deploying a [Chinese fine-tuned model of llama3 ](https://huggingface.co/hfl/llama-3-chinese-8b-instruct-gguf) How to solve this problem? Modelfile file: ```Modelfile FROM /llama-3-chinese-8b-instruct/ggml-model-q8_0.gguf TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|> {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|> {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|> {{ .Response }}<|eot_id|>""" SYSTEM """""" PARAMETER num_keep 24 PARAMETER stop <|start_header_id|> PARAMETER stop <|end_header_id|> PARAMETER stop <|eot_id|> PARAMETER stop assistant ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.1.32
GiteaMirror added the bug label 2026-05-03 18:07:07 -05:00
Author
Owner

@pdevine commented on GitHub (Apr 30, 2024):

Can you try running it in the REPL and adding:

/set parameter stop <|reserved_special_token

(without the trailing >)

<!-- gh-comment-id:2086653525 --> @pdevine commented on GitHub (Apr 30, 2024): Can you try running it in the REPL and adding: ``` /set parameter stop <|reserved_special_token ``` (without the trailing >)
Author
Owner

@gavinliu commented on GitHub (May 24, 2024):

0.1.33 is fix

<!-- gh-comment-id:2128277010 --> @gavinliu commented on GitHub (May 24, 2024): 0.1.33 is fix
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#64554