From e86dff5818b8f8b07f349aa994a1c718029bb65c Mon Sep 17 00:00:00 2001 From: John <78893154+cmp-nct@users.noreply.github.com> Date: Tue, 30 Jan 2024 15:54:30 +0100 Subject: [PATCH] Update reader.py --- gguf-py/examples/reader.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gguf-py/examples/reader.py b/gguf-py/examples/reader.py index 1d0b97208..ff97d4419 100644 --- a/gguf-py/examples/reader.py +++ b/gguf-py/examples/reader.py @@ -4,18 +4,18 @@ from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent)) -from gguf.gguf_reader import GGUFReader +from gguf.gguf_reader import GGUFReader def read_gguf_file(gguf_file_path): """ Reads and prints key-value pairs and tensor information from a GGUF file in an improved format. - + Parameters: - gguf_file_path: Path to the GGUF file. """ - + reader = GGUFReader(gguf_file_path) - + # List all key-value pairs in a columnized format print("Key-Value Pairs:") max_key_length = max(len(key) for key in reader.fields.keys()) @@ -23,7 +23,7 @@ def read_gguf_file(gguf_file_path): value = field.parts[field.data[0]] print(f"{key:{max_key_length}} : {value}") print("----") - + # List all tensors print("Tensors:") tensor_info_format = "{:<30} | Shape: {:<15} | Size: {:<12} | Quantization: {}"