]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
gguf-py: fixed local detection of gguf package (#11180)
authorVinesh Janarthanan <redacted>
Sat, 11 Jan 2025 09:42:31 +0000 (03:42 -0600)
committerGitHub <redacted>
Sat, 11 Jan 2025 09:42:31 +0000 (11:42 +0200)
* updated path to gguf package for non-installed setups

* added reader.py to readme

* Bumped gguf version to 0.15.0

gguf-py/README.md
gguf-py/gguf/scripts/gguf_convert_endian.py
gguf-py/gguf/scripts/gguf_dump.py
gguf-py/gguf/scripts/gguf_hash.py
gguf-py/gguf/scripts/gguf_new_metadata.py
gguf-py/gguf/scripts/gguf_set_metadata.py
gguf-py/pyproject.toml

index 37a75923b6fe1f0a397c7630b7be06459b715a20..2e513633d1c5abbd2c9089d36dc09cbd9f474658 100644 (file)
@@ -15,6 +15,8 @@ pip install gguf
 
 [examples/writer.py](https://github.com/ggerganov/llama.cpp/blob/master/gguf-py/examples/writer.py) — Generates `example.gguf` in the current directory to demonstrate generating a GGUF file. Note that this file cannot be used as a model.
 
+[examples/reader.py](https://github.com/ggerganov/llama.cpp/blob/master/gguf-py/examples/reader.py) — Extracts and displays key-value pairs and tensor details from a GGUF file in a readable format.
+
 [gguf/scripts/gguf_dump.py](https://github.com/ggerganov/llama.cpp/blob/master/gguf-py/gguf/scripts/gguf_dump.py) — Dumps a GGUF file's metadata to the console.
 
 [gguf/scripts/gguf_set_metadata.py](https://github.com/ggerganov/llama.cpp/blob/master/gguf-py/gguf/scripts/gguf_set_metadata.py) — Allows changing simple metadata values in a GGUF file by key.
index b698af0fe763165ceff343f787996232f337de17..f97e91bd4c26fdb10a89d39a60b50aa53ec05c8d 100755 (executable)
@@ -11,8 +11,8 @@ from pathlib import Path
 import numpy as np
 
 # Necessary to load the local gguf package
-if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent / 'gguf-py').exists():
-    sys.path.insert(0, str(Path(__file__).parent.parent))
+if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent.parent / 'gguf-py').exists():
+    sys.path.insert(0, str(Path(__file__).parent.parent.parent))
 
 import gguf
 
index 1b65465419ddb1fd6f58594881c12ea623afeeed..f95b4fd4827c69dcc28829c67babf4ba71b5ca51 100755 (executable)
@@ -12,8 +12,8 @@ from typing import Any
 import numpy as np
 
 # Necessary to load the local gguf package
-if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent / 'gguf-py').exists():
-    sys.path.insert(0, str(Path(__file__).parent.parent))
+if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent.parent / 'gguf-py').exists():
+    sys.path.insert(0, str(Path(__file__).parent.parent.parent))
 
 from gguf import GGUFReader, GGUFValueType, ReaderTensor  # noqa: E402
 
index ee34d09bfe7ef67b0bddf709faa3a578fafc3224..3ef98992197e987d8aefc8fb5f5bf9c787e9d06a 100755 (executable)
@@ -13,8 +13,8 @@ from pathlib import Path
 from tqdm import tqdm
 
 # Necessary to load the local gguf package
-if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent / 'gguf-py').exists():
-    sys.path.insert(0, str(Path(__file__).parent.parent))
+if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent.parent / 'gguf-py').exists():
+    sys.path.insert(0, str(Path(__file__).parent.parent.parent))
 
 from gguf import GGUFReader  # noqa: E402
 
index fce52a8c1164e7948b993bdb6e2ff0302114fb36..a8cfc9d581b3d657f28df7e741c0faf4dbef3664 100755 (executable)
@@ -13,8 +13,8 @@ from tqdm import tqdm
 from typing import Any, Sequence, NamedTuple
 
 # Necessary to load the local gguf package
-if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent / 'gguf-py').exists():
-    sys.path.insert(0, str(Path(__file__).parent.parent))
+if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent.parent / 'gguf-py').exists():
+    sys.path.insert(0, str(Path(__file__).parent.parent.parent))
 
 import gguf
 
index e35b651b81da8c2bc007731dc8b2591529f3d615..f5809c35c887086f8055e828719041f8ae3ea749 100755 (executable)
@@ -6,8 +6,8 @@ import sys
 from pathlib import Path
 
 # Necessary to load the local gguf package
-if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent / 'gguf-py').exists():
-    sys.path.insert(0, str(Path(__file__).parent.parent))
+if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent.parent / 'gguf-py').exists():
+    sys.path.insert(0, str(Path(__file__).parent.parent.parent))
 
 from gguf import GGUFReader  # noqa: E402
 
index 92d7f22ec7dc64a715176c4333c43c42563158bc..78c6baa64a3656ea6f08d75de060024a701a4b0a 100644 (file)
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "gguf"
-version = "0.14.0"
+version = "0.15.0"
 description = "Read and write ML models in GGUF for GGML"
 authors = ["GGML <ggml@ggml.ai>"]
 packages = [