[GH-ISSUE #3974] error loading model architecture: unknown model architecture: 'phi3' #28217

Closed
opened 2026-04-22 06:07:41 -05:00 by GiteaMirror · 12 comments
Owner

Originally created by @sanyuan0704 on GitHub (Apr 27, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3974

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

When i fine-tuned the phi3 and quantize it with latest llama.cpp, i found ollama cannot load the model:

image

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.1.32

Originally created by @sanyuan0704 on GitHub (Apr 27, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3974 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? When i fine-tuned the phi3 and quantize it with latest llama.cpp, i found ollama cannot load the model: ![image](https://github.com/ollama/ollama/assets/39261479/6c1cf96f-9bd7-4436-9b92-9d76537fde58) ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.1.32
GiteaMirror added the bug label 2026-04-22 06:07:41 -05:00
Author
Owner

@dotnetautor commented on GitHub (Apr 27, 2024):

+1

<!-- gh-comment-id:2080398772 --> @dotnetautor commented on GitHub (Apr 27, 2024): +1
Author
Owner

@johanteekens commented on GitHub (Apr 28, 2024):

+1

<!-- gh-comment-id:2081488512 --> @johanteekens commented on GitHub (Apr 28, 2024): +1
Author
Owner

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

same for me :(

<!-- gh-comment-id:2085248536 --> @mildwood commented on GitHub (Apr 30, 2024): same for me :(
Author
Owner

@fran-pastor commented on GitHub (Apr 30, 2024):

+1

<!-- gh-comment-id:2085785240 --> @fran-pastor commented on GitHub (Apr 30, 2024): +1
Author
Owner

@Phil-T1 commented on GitHub (May 1, 2024):

Me too.

<!-- gh-comment-id:2088495682 --> @Phil-T1 commented on GitHub (May 1, 2024): Me too.
Author
Owner

@kroni66 commented on GitHub (May 1, 2024):

Me too

<!-- gh-comment-id:2088705044 --> @kroni66 commented on GitHub (May 1, 2024): Me too
Author
Owner

@Phil-T1 commented on GitHub (May 1, 2024):

This is due to a recent change to the microsoft/Phi-3-mini-4k-instruct-gguf model apparently.

Apologies for not being specific as I'm on the move, but I replaced the Phi3 download I did today which gave the unknown Phi3 model architecture error, with a download from a couple of weeks ago, and the error went away.

I think Microsoft just changed the label from lama3 to phi3 in the latest version.

<!-- gh-comment-id:2088985676 --> @Phil-T1 commented on GitHub (May 1, 2024): This is due to a recent change to the microsoft/Phi-3-mini-4k-instruct-gguf model apparently. Apologies for not being specific as I'm on the move, but I replaced the Phi3 download I did today which gave the unknown Phi3 model architecture error, with a download from a couple of weeks ago, and the error went away. I think Microsoft just changed the label from lama3 to phi3 in the latest version.
Author
Owner

@robbiemu commented on GitHub (May 1, 2024):

this discussion may be tracking the resolution: https://github.com/ggerganov/llama.cpp/issues/6849

<!-- gh-comment-id:2088990826 --> @robbiemu commented on GitHub (May 1, 2024): this discussion may be tracking the resolution: https://github.com/ggerganov/llama.cpp/issues/6849
Author
Owner

@dhiltgen commented on GitHub (May 1, 2024):

Initial support for phi3 was added in 0.1.32, and conversion should be working in 0.1.33. Please give the latest RC a try and let us know if you're still having problems.

https://github.com/ollama/ollama/releases

<!-- gh-comment-id:2089207020 --> @dhiltgen commented on GitHub (May 1, 2024): Initial support for phi3 was added in 0.1.32, and conversion should be working in 0.1.33. Please give the latest RC a try and let us know if you're still having problems. https://github.com/ollama/ollama/releases
Author
Owner

@MuazmaZ commented on GitHub (May 14, 2024):

+1

<!-- gh-comment-id:2109099432 --> @MuazmaZ commented on GitHub (May 14, 2024): +1
Author
Owner

@yorek commented on GitHub (May 14, 2024):

Hi, I've just tried latest version 0.1.37 and now I get the following error:

lama_model_load: error loading model: tensor 'blk.26.ffn_up.weight' data is not within the file bounds, model is corrupted or incomplete

here's the Modelfile I'm using:

FROM ./Phi-3-mini-4k-instruct-fp16.gguf
TEMPLATE """<s>{{ if .Prompt }}<|user|>
{{ .Prompt }}<|end|>
{{ end }}<|assistant|>
{{ .Response }}<|end|>"""
PARAMETER stop <|endoftext|>
PARAMETER stop <|assistant|>
PARAMETER stop <|end|>
PARAMETER num_ctx 4096

the GGUF file is coming from the Hugging Face MS repo:

https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf/tree/main

Thanks

<!-- gh-comment-id:2109110531 --> @yorek commented on GitHub (May 14, 2024): Hi, I've just tried latest version 0.1.37 and now I get the following error: ``` lama_model_load: error loading model: tensor 'blk.26.ffn_up.weight' data is not within the file bounds, model is corrupted or incomplete ``` here's the Modelfile I'm using: ``` FROM ./Phi-3-mini-4k-instruct-fp16.gguf TEMPLATE """<s>{{ if .Prompt }}<|user|> {{ .Prompt }}<|end|> {{ end }}<|assistant|> {{ .Response }}<|end|>""" PARAMETER stop <|endoftext|> PARAMETER stop <|assistant|> PARAMETER stop <|end|> PARAMETER num_ctx 4096 ``` the GGUF file is coming from the Hugging Face MS repo: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf/tree/main Thanks
Author
Owner

@jmorganca commented on GitHub (Jun 4, 2024):

Hi all this should be fixed now. Sorry about the errors - let me know if you're still seeing it on the latest version of Ollama

<!-- gh-comment-id:2146736176 --> @jmorganca commented on GitHub (Jun 4, 2024): Hi all this should be fixed now. Sorry about the errors - let me know if you're still seeing it on the latest version of Ollama
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#28217