Skip to content

Commit 530666f

Browse files
committed
reader.py: read_gguf_file() use print() over logging
1 parent 580aa9a commit 530666f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

gguf-py/examples/reader.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ def read_gguf_file(gguf_file_path):
2020
reader = GGUFReader(gguf_file_path)
2121

2222
# List all key-value pairs in a columnized format
23-
logger.info("Key-Value Pairs:")
23+
print("Key-Value Pairs:") # noqa: NP100
2424
max_key_length = max(len(key) for key in reader.fields.keys())
2525
for key, field in reader.fields.items():
2626
value = field.parts[field.data[0]]
27-
logger.info(f"{key:{max_key_length}} : {value}")
28-
logger.info("----")
27+
print(f"{key:{max_key_length}} : {value}") # noqa: NP100
28+
print("----") # noqa: NP100
2929

3030
# List all tensors
31-
logger.info("Tensors:")
31+
print("Tensors:") # noqa: NP100
3232
tensor_info_format = "{:<30} | Shape: {:<15} | Size: {:<12} | Quantization: {}"
33-
logger.info(tensor_info_format.format("Tensor Name", "Shape", "Size", "Quantization"))
34-
logger.info("-" * 80)
33+
print(tensor_info_format.format("Tensor Name", "Shape", "Size", "Quantization")) # noqa: NP100
34+
print("-" * 80) # noqa: NP100
3535
for tensor in reader.tensors:
3636
shape_str = "x".join(map(str, tensor.shape))
3737
size_str = str(tensor.n_elements)
3838
quantization_str = tensor.tensor_type.name
39-
logger.info(tensor_info_format.format(tensor.name, shape_str, size_str, quantization_str))
39+
print(tensor_info_format.format(tensor.name, shape_str, size_str, quantization_str)) # noqa: NP100
4040

4141

4242
if __name__ == '__main__':

0 commit comments

Comments
 (0)