[GH-ISSUE #4000] Error: invalid file magic when trying to import a custom gguf model to ollama instance #2478

Closed
opened 2026-04-12 12:48:36 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @atb29 on GitHub (Apr 28, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4000

What is the issue?

i got this error
"E:\phi3-mini-128k-gguf\model>ollama create phi-3-mini-128k -f Modelfile
transferring model data
creating model layer
Error: invalid file magic"

here is the modelfile used
FROM ./Phi-3-mini-128k-instruct.IQ4_XS.gguf

PARAMETER num_ctx 65536
PARAMETER num_keep 4
PARAMETER stop <|user|>
PARAMETER stop <|assistant|>
PARAMETER stop <|system|>
PARAMETER stop <|end|>
PARAMETER stop <|endoftext|>

TEMPLATE """
{{ if .System }}<|system|>
{{ .System }}<|end|>
{{ end }}{{ if .Prompt }}<|user|>
{{ .Prompt }}<|end|>
{{ end }}<|assistant|>
{{ .Response }}<|end|>
"""

OS

Windows

GPU

No response

CPU

No response

Ollama version

0.1.31

Originally created by @atb29 on GitHub (Apr 28, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4000 ### What is the issue? i got this error "E:\phi3-mini-128k-gguf\model>ollama create phi-3-mini-128k -f Modelfile transferring model data creating model layer Error: invalid file magic" here is the modelfile used FROM ./Phi-3-mini-128k-instruct.IQ4_XS.gguf PARAMETER num_ctx 65536 PARAMETER num_keep 4 PARAMETER stop <|user|> PARAMETER stop <|assistant|> PARAMETER stop <|system|> PARAMETER stop <|end|> PARAMETER stop <|endoftext|> TEMPLATE """ {{ if .System }}<|system|> {{ .System }}<|end|> {{ end }}{{ if .Prompt }}<|user|> {{ .Prompt }}<|end|> {{ end }}<|assistant|> {{ .Response }}<|end|> """ ### OS Windows ### GPU _No response_ ### CPU _No response_ ### Ollama version 0.1.31
GiteaMirror added the bug label 2026-04-12 12:48:36 -05:00
Author
Owner

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

Hi @atb29 sorry about this issue, this error is due to the fact you are trying to load phi with IQ quantization, which isn't supported yet.

It looks like there are some other open issues to get Ollama to support IQ quantization, so I'm going to resolve this issue for now to keep things organized around #3622. Please follow that issue to keep up to date with when we get the IQ support in.

<!-- gh-comment-id:2089084406 --> @BruceMacD commented on GitHub (May 1, 2024): Hi @atb29 sorry about this issue, this error is due to the fact you are trying to load phi with IQ quantization, which isn't supported yet. It looks like there are some other open issues to get Ollama to support IQ quantization, so I'm going to resolve this issue for now to keep things organized around #3622. Please follow that issue to keep up to date with when we get the IQ support in.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2478