From 28ba975aea1dcae2f31770516f5d542ff177771e Mon Sep 17 00:00:00 2001
From: dotpy314 <33351922+dotpy314@users.noreply.github.com>
Date: Tue, 28 Mar 2023 23:06:28 +0800
Subject: [PATCH] Check the existence of f16_model_path_base in quantize.py
 (#574)

Co-authored-by: Jincheng Miao <jincheng.miao@gmail.com>
---
 quantize.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/quantize.py b/quantize.py
index 16b5963..641df8d 100644
--- a/quantize.py
+++ b/quantize.py
@@ -74,6 +74,10 @@ def main():
             args.models_path, model, "ggml-model-f16.bin"
         )
 
+        if not os.path.isfile(f16_model_path_base):
+            print(f'The file %s was not found' % f16_model_path_base)
+            sys.exit(1)
+
         f16_model_parts_paths = map(
             lambda filename: os.path.join(f16_model_path_base, filename),
             glob.glob(f"{f16_model_path_base}*")