Jelajahi Sumber

Fix gguf-convert-endian script (#4037)

* Fix gguf-convert-endian script

* Bump version and update description
M. Yusuf Sarıgöz 2 tahun lalu
induk
melakukan
e86fc56f75
2 mengubah file dengan 3 tambahan dan 4 penghapusan
  1. 2 2
      gguf-py/pyproject.toml
  2. 1 2
      gguf-py/scripts/gguf-convert-endian.py

+ 2 - 2
gguf-py/pyproject.toml

@@ -1,7 +1,7 @@
 [tool.poetry]
 [tool.poetry]
 name = "gguf"
 name = "gguf"
-version = "0.5.0"
-description = "Write ML models in GGUF for GGML"
+version = "0.5.1"
+description = "Read and write ML models in GGUF for GGML"
 authors = ["GGML <ggml@ggml.ai>"]
 authors = ["GGML <ggml@ggml.ai>"]
 packages = [
 packages = [
     {include = "gguf"},
     {include = "gguf"},

+ 1 - 2
gguf-py/scripts/gguf-convert-endian.py

@@ -28,8 +28,7 @@ def convert_byteorder(reader: gguf.GGUFReader, args: argparse.Namespace) -> None
         file_endian = swapped_endian
         file_endian = swapped_endian
     else:
     else:
         file_endian = host_endian
         file_endian = host_endian
-    if args.order == "native":
-        order = host_endian
+    order = host_endian if args.order == "native" else args.order
     print(f"* Host is {host_endian.upper()} endian, GGUF file seems to be {file_endian.upper()} endian")
     print(f"* Host is {host_endian.upper()} endian, GGUF file seems to be {file_endian.upper()} endian")
     if file_endian == order:
     if file_endian == order:
         print(f"* File is already {order.upper()} endian. Nothing to do.")
         print(f"* File is already {order.upper()} endian. Nothing to do.")