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

llama_init_from_file: failed to load model #388

Closed
alisonzhu opened this issue Mar 22, 2023 · 4 comments
Closed

llama_init_from_file: failed to load model #388

alisonzhu opened this issue Mar 22, 2023 · 4 comments
Labels
need more info The OP should provide more details about the issue

Comments

@alisonzhu
Copy link

When I execute this command:
make -j && ./main -m ./models/7B/ggml-model-q4_0.bin -p "Building a website can be done in 10 simple steps:" -n 512

An error was reported:
llama_init_from_file: failed to load model
main: error: failed to load model './models/7B/ggml-model-q4_0.bin'

@gjmulder
Copy link
Collaborator

Please use the issue template when opening issues so we can better understand your problem.

@gjmulder gjmulder added the need more info The OP should provide more details about the issue label Mar 22, 2023
@gjmulder gjmulder changed the title failed to load model llama_init_from_file: failed to load model Mar 22, 2023
@daisseur
Copy link

daisseur commented Mar 24, 2023

(i'm fench so sorry for my bad english)

Hello, i'm on ubuntu mate, distrib of linux i have python3.10.
[uname] Linux ordival-mate 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[python version] Python 3.10.6

I have the same error, i just paste this in my term:

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make

# obtain the original LLaMA model weights and place them in ./models
ls ./models
65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model

# install Python dependencies
python3 -m pip install torch numpy sentencepiece

# convert the 7B model to ggml FP16 format
python3 convert-pth-to-ggml.py models/7B/ 1

# quantize the model to 4-bits
python3 quantize.py 7B

# run the inference
./main -m ./models/7B/ggml-model-q4_0.bin -n 128

And i have error: 65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model 65B: command not found

And when i run this command i have the error "fail to load model":
~/llama.cpp$ make -j && ./main -m ./models/7B/ggml-model-q4_0.bin -p "Building a website can be done in 10 simple steps:" -n 512
I llama.cpp build info: I UNAME_S: Linux I UNAME_P: x86_64 I UNAME_M: x86_64
I CFLAGS: -I. -O3 -DNDEBUG -std=c11 -fPIC -pthread -msse3
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread
`I LDFLAGS:
I CC: cc (Ubuntu 11.3.0-1ubuntu122.04) 11.3.0
I CXX: g++ (Ubuntu 11.3.0-1ubuntu1
22.04) 11.3.0

make: Nothing to be done for 'default'.
main: seed = 1679618071
llama_model_load: loading model from './models/7B/ggml-model-q4_0.bin' - please wait ...
llama_model_load: failed to open './models/7B/ggml-model-q4_0.bin'
llama_init_from_file: failed to load model
main: error: failed to load model './models/7B/ggml-model-q4_0.bin'`

@j-f1
Copy link
Collaborator

j-f1 commented Mar 24, 2023

# obtain the original LLaMA model weights and place them in ./models
ls ./models
65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model

This part is saying that you’ll need to find the model files yourself and put them in the models folder. We can’t help with that part, but once you have them downloaded the commands after that should work.

@adam-the-hacker
Copy link

(i'm fench so sorry for my bad english)

Hello, i'm on ubuntu mate, distrib of linux i have python3.10. [uname] Linux ordival-mate 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux [python version] Python 3.10.6

I have the same error, i just paste this in my term:

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make

# obtain the original LLaMA model weights and place them in ./models
ls ./models
65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model

# install Python dependencies
python3 -m pip install torch numpy sentencepiece

# convert the 7B model to ggml FP16 format
python3 convert-pth-to-ggml.py models/7B/ 1

# quantize the model to 4-bits
python3 quantize.py 7B

# run the inference
./main -m ./models/7B/ggml-model-q4_0.bin -n 128

And i have error: 65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model 65B: command not found

And when i run this command i have the error "fail to load model": ~/llama.cpp$ make -j && ./main -m ./models/7B/ggml-model-q4_0.bin -p "Building a website can be done in 10 simple steps:" -n 512 I llama.cpp build info: I UNAME_S: Linux I UNAME_P: x86_64 I UNAME_M: x86_64 I CFLAGS: -I. -O3 -DNDEBUG -std=c11 -fPIC -pthread -msse3 I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread `I LDFLAGS: I CC: cc (Ubuntu 11.3.0-1ubuntu122.04) 11.3.0 I CXX: g++ (Ubuntu 11.3.0-1ubuntu122.04) 11.3.0

make: Nothing to be done for 'default'. main: seed = 1679618071 llama_model_load: loading model from './models/7B/ggml-model-q4_0.bin' - please wait ... llama_model_load: failed to open './models/7B/ggml-model-q4_0.bin' llama_init_from_file: failed to load model main: error: failed to load model './models/7B/ggml-model-q4_0.bin'`

Hello, i'll explain in french.
Tu ne dois pas éxécuter la commande "65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model 65B". Cette ligne décrit ce que l'ordinateur doit afficher après avoir éxécuté la commande "ls ./models"
Dans le dossier "models" tu dois avoir au moins un des 4 dossiers qui s'appellent "65B", "30B"... ect, et qui correspond a la version du modèle de language que tu as téléchargé.
Aussi, tu devras chercher dans un des dossiers le fichier "quantize" ; je te conseille de le copier et de le coller dans le dossier principal "llama.cpp" et ensuite d'éxécuter la dernière commande.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info The OP should provide more details about the issue
Projects
None yet
Development

No branches or pull requests

5 participants