aboutsummaryrefslogtreecommitdiff
path: root/convert-pth-to-ggml.py
diff options
context:
space:
mode:
Diffstat (limited to 'convert-pth-to-ggml.py')
-rw-r--r--convert-pth-to-ggml.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/convert-pth-to-ggml.py b/convert-pth-to-ggml.py
index 5c36e9c..d0eb213 100644
--- a/convert-pth-to-ggml.py
+++ b/convert-pth-to-ggml.py
@@ -16,7 +16,7 @@
# At the start of the ggml file we write the model parameters
# and vocabulary.
#
-
+import os
import sys
import json
import struct
@@ -64,6 +64,10 @@ if len(sys.argv) > 2:
sys.exit(1)
fname_out = sys.argv[1] + "/ggml-model-" + ftype_str[ftype] + ".bin"
+if os.path.exists(fname_out):
+ print(f"Skip conversion, it already exists: {fname_out}")
+ sys.exit(0)
+
with open(fname_hparams, "r") as f:
hparams = json.load(f)