-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
raise NameError(f"Could not load Llama model from path: {model_path}") NameError: Could not load Llama model from path: models/ggml-model-q4_0.bin #140
Comments
Did you download and place the model in the models folder? |
@BassAzayda Yup the models are in a folder called models. And this is what's in my .env : PERSIST_DIRECTORY=db |
If using Windows could it be the slashes need to be the other way? Sorry Mac user here? |
@BassAzayda I thought about that as a possibility, which is why I'm trying it also on WSL (Ubuntu). |
@BassAzayda Unfortunately changing the slashes doesn't work :( Nor does providing the full path. It seems like the path isn't the problem here but rather an actual problem with loading the model due to the version of python and the library being used. |
@imartinez Any solution to this? |
You have to have the same python version, if it is a python version related problem. I think someone with a similar problem solved it by updating his to latest. |
@d2rgaming-9000 i do have the latest Python 3.11.3 |
@b007zk have you tried passing absolute path instead of relative pat in the Where And make sure you use |
@smileBeda yes I have tried that, no luck unfortunately. I don't think the path is the problem here. |
@aHardReset Hey, thanks for your comment. I actually tried with your changes but unfortunately still running into the following issue when I run the privateGPT.py Traceback (most recent call last): |
pip install llama-cpp-python==0.1.48 resolved my issue, along with when using |
@kuppu thanks but that didn't work for me. |
Try running Python 3.10.X use pyenv if available on windows so you can switch environments as well as try another embeddings model from huggingface? |
cpp is pretty f*'d up so is it possible to just use the koboldcpp.exe file as a server for this?
and then have
or whatever as core dependencies. Pytorch is also often an important dependency for llama models to run above 10 t/s, but different GPUs have different CUDA requirements. eg, tesla k80/p40/H100 or GTX660/RTX4090 not to mention AMD |
PS D:\privateGPT> python .\privateGPT.py
llama.cpp: loading model from models/ggml-model-q4_0.bin
llama.cpp: can't use mmap because tensors are not aligned; convert to new format to avoid this
llama_model_load_internal: format = 'ggml' (old version with low tokenizer quality and no mmap support)
llama_model_load_internal: n_vocab = 32000
llama_model_load_internal: n_ctx = 1000
llama_model_load_internal: n_embd = 4096
llama_model_load_internal: n_mult = 256
llama_model_load_internal: n_head = 32
llama_model_load_internal: n_layer = 32
llama_model_load_internal: n_rot = 128
llama_model_load_internal: ftype = 2 (mostly Q4_0)
llama_model_load_internal: n_ff = 11008
llama_model_load_internal: n_parts = 1
llama_model_load_internal: model size = 7B
error loading model: this format is no longer supported (see ggerganov/llama.cpp#1305)
llama_init_from_file: failed to load model
Traceback (most recent call last):
File "C:\Users<user>\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\embeddings\llamacpp.py", line 78, in validate_environment
values["client"] = Llama(
^^^^^^
File "C:\Users<user>\AppData\Local\Programs\Python\Python311\Lib\site-packages\llama_cpp\llama.py", line 161, in init
assert self.ctx is not None
^^^^^^^^^^^^^^^^^^^^
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\privateGPT\privateGPT.py", line 57, in
main()
File "D:\privateGPT\privateGPT.py", line 21, in main
llama = LlamaCppEmbeddings(model_path=llama_embeddings_model, n_ctx=model_n_ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic\main.py", line 339, in pydantic.main.BaseModel.init
File "pydantic\main.py", line 1102, in pydantic.main.validate_model
File "C:\Users<user>\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\embeddings\llamacpp.py", line 98, in validate_environment
raise NameError(f"Could not load Llama model from path: {model_path}")
NameError: Could not load Llama model from path: models/ggml-model-q4_0.bin
The text was updated successfully, but these errors were encountered: