AttributeError: function 'llama_get_kv_self' not found. Did you mean: 'llama_get_model'? after compiling llama-cpp-python on Windows
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
研究方向
錯誤發生在 llama_cpp.py 第 1408 行,其中 ctypes 函式裝飾器嘗試從已編譯的函式庫載入 'llama_get_kv_self'。檢查底層 llama.cpp 函式庫的版本及其匯出的符號,尤其是在 Windows 上進行啟用 CUDA 的建置之後。將 _ctypes_extensions.py 中的繫結與實際的 DLL 進行比較。修正可能需要更新繫結,或確保使用正確的 llama.cpp commit。
由索引模型根據 Issue 內容生成。
描述
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- I am running the latest code. Development is very rapid so there are no tagged versions as of now.
- I carefully followed the README.md.
- I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
- I reviewed the Discussions, and have a new bug or useful enhancement to share.
Expected Behavior
Hello, basically I am trying to compile and install llama-cpp-python with cuda on Windows 11 following this https://github.com/abetlen/llama-cpp-python/issues/1963 guide. It installs perfectly fine, but I am running into the issue mentioned in the header.
Current Behavior
when importing Llama in a python script, I get the following error:
AttributeError: function 'llama_get_kv_self' not found. Did you mean: 'llama_get_model'?
it is thrown when calling
import llama_cpp
Environment and Context
I am using Windows 11 using a Ryzen 5700x and an RTX 4070. I am trying to install llama-cpp-python into a venv based on Python 3.11.9 and have also tried it with Python 3.13.xx. Also tested straight into python without venv.
Failure Information (for bugs)
Traceback (most recent call last):
File ".\testLlamaCpp.py", line 1, in
import llama_cpp
File "..venv\Lib\site-packages\llama_cpp_init_.py", line 1, in
from .llama_cpp import *
File "..venv\Lib\site-packages\llama_cpp\llama_cpp.py", line 1408, in
@ctypes_function(
^^^^^^^^^^^^^^^^
File "..venv\Lib\site-packages\llama_cpp_ctypes_extensions.py", line 113, in decorator
func = getattr(lib, name)
^^^^^^^^^^^^^^^^^^
File "\AppData\Local\Programs\Python\Python311\Lib\ctypes_init_.py", line 389, in getattr\AppData\Local\Programs\Python\Python311\Lib\ctypes_init_.py", line 394, in getitem
func = self.getitem(name)
^^^^^^^^^^^^^^^^^^^^^^
File "
func = self._FuncPtr((name_or_ordinal, self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: function 'llama_get_kv_self' not found. Did you mean: 'llama_get_model'?
Steps to Reproduce
Compile llama-cpp-python on windows using the guide mentioned.
import llama_cpp
- 主要語言
- Python
- 星號
- 10.6k
- 分支
- 1.5k
- 平均合併
- 3 小時 57 分鐘
- 30 天內合併 PR
- 4
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
abetlen/llama-cpp-python 的其他 Issue
-
Seven llama_sampler_init_* bindings admit keyword arguments that the ctypes function object silently drops可能已有人在做 @Belal0066 於 14 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
abetlen/llama-cpp-python#2371 ·
維護者通常 1 天內回覆
-
uv add llama-cpp-python wheels fails for versions above 0.3.30可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2352 · 1 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
Docs: consolidate build-from-source and GPU backend guide可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
abetlen/llama-cpp-python#2314 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2211 · 2 則留言 ·
維護者通常 1 天內回覆
-
Llama() silently accepts and discards `embedding` kwarg; .embed() then raises confusingly可能已有人在做 @Anai-Guo 於 31 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2210 ·
維護者通常 1 天內回覆
查看 abetlen/llama-cpp-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 86/100
FuRongJun-1999/dsh-memory#65 ·
維護者通常 1 天內回覆
-
ci needs-ac
難度 2/5 1-3 小時 新手友好度 75/100
Ikalus1988/MisakaNet#2930 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
Qiskit/qiskit-aer#2466 ·
-
area/cli
難度 2/5 1-3 小時 新手友好度 82/100