diff --git a/gguf-py/examples/reader.py b/gguf-py/examples/reader.py index 3d455e8a3..62e0769da 100644 --- a/gguf-py/examples/reader.py +++ b/gguf-py/examples/reader.py @@ -6,6 +6,7 @@ from gguf.gguf_reader import GGUFReader sys.path.insert(0, str(Path(__file__).parent.parent)) + def read_gguf_file(gguf_file_path): """ Reads and prints key-value pairs and tensor information from a GGUF file in an improved format. @@ -35,6 +36,7 @@ def read_gguf_file(gguf_file_path): quantization_str = tensor.tensor_type.name print(tensor_info_format.format(tensor.name, shape_str, size_str, quantization_str)) + if __name__ == '__main__': if len(sys.argv) < 2: print("Usage: reader.py ")