Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't run:invalid model file #27

Closed
ukhack opened this issue Apr 7, 2023 · 13 comments · Fixed by #39
Closed

can't run:invalid model file #27

ukhack opened this issue Apr 7, 2023 · 13 comments · Fixed by #39

Comments

@ukhack
Copy link

ukhack commented Apr 7, 2023

Got Error

llama_model_load: loading model from './models/gpt4all-lora-quantized-ggml.bin' - please wait ...
./models/gpt4all-lora-quantized-ggml.bin: invalid model file (bad magic [got 0x67676d66 want 0x67676a74])
you most likely need to regenerate your ggml files
the benefit is you'll get 10-100x faster load times
see ggml-org/llama.cpp#91
use convert-pth-to-ggml.py to regenerate from original pth
use migrate-ggml-2023-03-30-pr613.py if you deleted originals
llama_init_from_file: failed to load model

Enviroment

M1 Pro Mac
model file md5 is 387eeb7cba52aaa278ebc2fe386649b1 equal md5 file on website
But I can run original gpt4all clone from github.just clone,download model file in chat folder and run.

@ukhack
Copy link
Author

ukhack commented Apr 7, 2023

I solved it!

@CaptainChemist
Copy link

@ukhack - how did you solve it? I have the same error.

@lukas-schwab
Copy link

@CaptainChemist You have to apply migrate-ggml-2023-03-30-pr613.py from llama.cpp to the faulty model file. Takes just a few seconds.

@ParisNeo
Copy link
Owner

ParisNeo commented Apr 7, 2023

I'll talk to nomic-ai so that they deploy other models.

@NJannasch
Copy link
Contributor

@CaptainChemist You have to apply migrate-ggml-2023-03-30-pr613.py from llama.cpp to the faulty model file. Takes just a few seconds.

# In the same repo as your gpt4all-ui
git clone https://github.com/ggerganov/llama.cpp.git
# Transform the model
python3 llama.cpp/migrate-ggml-2023-03-30-pr613.py models/gpt4all-lora-quantized-ggml.bin models/gpt4all-lora-quantized-ggml_converted.bin

# And now change the names to allow proper usage
mv models/gpt4all-lora-quantized-ggml.bin models/gpt4all-lora-quantized-ggml.bin.orig
mv models/gpt4all-lora-quantized-ggml_converted.bin models/gpt4all-lora-quantized-ggml.bin

@CaptainChemist
Copy link

Thank you, this did it! A note for anyone else stumbling across this- I had to call python3.11 specifically when executing this migration script, using the standard 3.9 did not work for me.

@ParisNeo
Copy link
Owner

ParisNeo commented Apr 7, 2023

I'm adding all this to the install.bat

arroyoquiel added a commit to arroyoquiel/gpt4all-ui that referenced this issue Apr 8, 2023
As NJannasch mentioned, the model won't work unless the model gets changed by llama.cpp\migrate-ggml-2023-03-30-pr613.py.

This batch works as follows

1) Activates the virtual environment and Runs the Python app.
2) If the model gives an error, it asks you [Y/N] if you want to fix the model, N exits the batch, Y fixes it.
3) It renames the model so it conserves the original, and then applies the fix as a new model. After that it tells that the model has been fixed. Press any key to restart.
4) Pressing a key makes the batch go to the start and the UI launches successfully.
@arroyoquiel arroyoquiel mentioned this issue Apr 8, 2023
9 tasks
arroyoquiel added a commit to arroyoquiel/gpt4all-ui that referenced this issue Apr 8, 2023
As NJannasch mentioned, the model won't work unless the model gets changed by llama.cpp\migrate-ggml-2023-03-30-pr613.py.

This batch works as follows

Activates the virtual environment and Runs the Python app.
If the model gives an error, it asks you [Y/N] if you want to fix the model, N exits the batch, Y fixes it.
It renames the model so it conserves the original, and then applies the fix as a new model. After that it tells that the model has been fixed. Press any key to restart.
Pressing a key makes the batch go to the start and the UI launches successfully.

Added a remark
ParisNeo added a commit that referenced this issue Apr 8, 2023
@geekyme
Copy link

geekyme commented Apr 9, 2023

This should be fixed on the install.sh as well.

@ParisNeo
Copy link
Owner

ParisNeo commented Apr 9, 2023

You are right. I'll do it as soon as i can.

@djaffer
Copy link

djaffer commented Apr 9, 2023

Why not just upload the correct format file instead of having to do all this. I just downloaded the file and got the same issue. Even the latest file is not converted.

@ParisNeo
Copy link
Owner

I'm waiting for the nomic-ai teams to release the next batch of models and they probably will be in the right format out of the box.

@cleverestx
Copy link

I got it working by conversion with the standard model, but the same process fails trying to use gpt4all-lora-unfiltered-quantized.bin -- how can I get this one working with the UI?? (or is there a better uncensored one to use with it?)

@ParisNeo
Copy link
Owner

Ok, I'll try to convert the unfiltered version and post it to the hugging face.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants