ParisNeo/lollms-webui

can't run:invalid model file

ukhack opened this issue · 13 comments

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 ggerganov/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.

I solved it!

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

@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.

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

@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

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.

I'm adding all this to the install.bat

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

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

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.

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.

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?)

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