Skip to content

Model with llama.cpp works, but not with llama-cpp-python #336

Closed as not planned
@gjmulder

Description

@gjmulder

Discussed in #334

Originally posted by icarus0508 June 7, 2023
Hi, i just build my llama.cpp model . it works fine on llama.cpp, but when i move the model to llama-cpp-python by following the code like:

nllm = LlamaCpp(
model_path="./ggml-model-q4_0.bin",
callback_manager=callback_manager,
verbose=True,
n_ctx=2048
)

it is always encount an error like this:

llama.cpp: loading model from ./ggml-model-q4_0.bin
error loading model: unrecognized tensor type 14

llama_init_from_file: failed to load model
2023-06-07 15:15:52.963 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\IamUser\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "D:\PythonPlayground\NN-Playgroud\chatbot_NPC_llama.py", line 39, in
nllm = LlamaCpp(
File "pydantic\main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for LlamaCpp
root
Could not load Llama model from path: ./ggml-model-q4_0.bin. Received error (type=value_error)

llama.cpp version : master-ffb06a3

llama-cpp-python: v0.157

it will work if i use older version of model and use v0.149 of llama-cpp-python

but i will like to use the lastest version. How can i solve this?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    modelModel specific issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions