AttributeError: function 'llama_get_kv_self' not found. Did you mean: 'llama_get_model'? after compiling llama-cpp-python on Windows
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Bereich
- ai-infra-agents, backend
Rechercherichtung
Der Fehler tritt in llama_cpp.py in Zeile 1408 auf, wo ein ctypes-Funktionsdekorator versucht, „llama_get_kv_self“ aus der kompilierten Bibliothek zu laden. Überprüfe die Version der zugrunde liegenden llama.cpp-Bibliothek und ihre exportierten Symbole, insbesondere nach einem CUDA-fähigen Build unter Windows. Vergleiche die Bindings in _ctypes_extensions.py mit der tatsächlichen DLL. Die Behebung besteht wahrscheinlich darin, das Binding zu aktualisieren oder sicherzustellen, dass der richtige llama.cpp-Commit verwendet wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 10.6k
- Forks
- 1.5k
- Ø Merge
- 3 Std. 57 Min.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus abetlen/llama-cpp-python
-
Seven llama_sampler_init_* bindings admit keyword arguments that the ctypes function object silently dropsEvtl. vergeben @Belal0066 hat das vor 15 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
abetlen/llama-cpp-python#2371 ·
Maintainer antworten meist innerhalb von 1 Tag
-
uv add llama-cpp-python wheels fails for versions above 0.3.30Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
abetlen/llama-cpp-python#2352 · 1 Kommentar · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Docs: consolidate build-from-source and GPU backend guideEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
abetlen/llama-cpp-python#2314 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Llama.embed() calls LlamaBatch.add_sequence with old 3-arg signature; missing logits_arrayEvtl. wieder frei @lxcxjxhx hat das vor 92 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
abetlen/llama-cpp-python#2211 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Llama() silently accepts and discards `embedding` kwarg; .embed() then raises confusinglyEvtl. vergeben @Anai-Guo hat das vor 33 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
abetlen/llama-cpp-python#2210 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in abetlen/llama-cpp-python
Ähnliche Issues
-
changelog investigate
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ramnes/notion-sdk-py#409 ·
-
good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
lindicaphxag-tech/kaggle#28 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
BSData/horus-heresy-3rd-edition#3211 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag