[GH-ISSUE #4349] The error occurred when running the fine-tuning trained Llama-3-8B-Instruct model #2712

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

Originally created by @zhangzhongpeng02 on GitHub (May 11, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4349

What is the issue?

I fine-tuning trained the Llama-3-8B-Instruct model and converting it to the UGFF model format. then run it by ollama,it's success,but errors happend when I send any msg,
the error:
time=2024-05-06T23:55:49.844+08:00 level=INFO source=server.go:829 msg="llm encode error: 500 Internal Server Error\ninvalid unordered_map<K, T> key"
time=2024-05-06T23:55:49.844+08:00 level=ERROR source=prompt.go:86 msg="failed to encode prompt" err="500 Internal Server Error\ninvalid unordered_map<K, T> key"

Then I tryed this:
1、The same error occurred when run the mode file which directly converting the original safetensors files of the Llama-3-8B-Instruct to the UGFF format.
2、I did the same operations on safetensors models such as qwen:14b-chat-v1.5, llama2-7b-chat, and Mistral-7B-Instruct, However, there were no errors!

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.1.34

Originally created by @zhangzhongpeng02 on GitHub (May 11, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4349 ### What is the issue? I fine-tuning trained the Llama-3-8B-Instruct model and converting it to the UGFF model format. then run it by ollama,it's success,but errors happend when I send any msg, the error: time=2024-05-06T23:55:49.844+08:00 level=INFO source=server.go:829 msg="llm encode error: 500 Internal Server Error\ninvalid unordered_map<K, T> key" time=2024-05-06T23:55:49.844+08:00 level=ERROR source=prompt.go:86 msg="failed to encode prompt" err="500 Internal Server Error\ninvalid unordered_map<K, T> key" Then I tryed this: 1、The same error occurred when run the mode file which directly converting the original safetensors files of the Llama-3-8B-Instruct to the UGFF format. 2、I did the same operations on safetensors models such as qwen:14b-chat-v1.5, llama2-7b-chat, and Mistral-7B-Instruct, However, there were no errors! ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.1.34
GiteaMirror added the bug label 2026-04-12 13:01:44 -05:00
Author
Owner

@zhangzhongpeng02 commented on GitHub (May 11, 2024):

The conversion operation refers to ”https://github.com/ollama/ollama/blob/main/docs/import.md“,and the commond is : python llm/llama.cpp/convert.py ./model --outtype f16 --outfile converted.bin
the modefile:
FROM converted.bin
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|>"""
PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "<|eot_id|>"
PARAMETER stop "<|reserved_special_token"

<!-- gh-comment-id:2105626729 --> @zhangzhongpeng02 commented on GitHub (May 11, 2024): The conversion operation refers to ”https://github.com/ollama/ollama/blob/main/docs/import.md“,and the commond is : python llm/llama.cpp/convert.py ./model --outtype f16 --outfile converted.bin the modefile: FROM converted.bin 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|>""" PARAMETER stop "<|start_header_id|>" PARAMETER stop "<|end_header_id|>" PARAMETER stop "<|eot_id|>" PARAMETER stop "<|reserved_special_token"
Author
Owner

@yuanmenglong-cn commented on GitHub (Jun 27, 2024):

Have you solved this issue? I'm running into this issue as well :(

<!-- gh-comment-id:2193075882 --> @yuanmenglong-cn commented on GitHub (Jun 27, 2024): Have you solved this issue? I'm running into this issue as well :(
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2712