diff options
Diffstat (limited to 'Biz/Mynion.py')
-rw-r--r-- | Biz/Mynion.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Biz/Mynion.py b/Biz/Mynion.py index 85eadc8..d3dabcf 100644 --- a/Biz/Mynion.py +++ b/Biz/Mynion.py @@ -1,5 +1,7 @@ +""" +Mynion is a helper. +""" # : out mynion -# # : dep exllama # : dep slixmpp import argparse @@ -192,9 +194,10 @@ def load_model(model_name: str) -> typing.Any: config_path = os.path.join(model_dir, "config.json") st_pattern = os.path.join(model_dir, "*.safetensors") st = glob.glob(st_pattern) - if len(st) != 1: - print("found multiple safetensors!") - sys.exit() + if len(st) > 1: + raise ValueError("found multiple safetensors!") + elif len(st) < 1: + raise ValueError("could not find model") model_path = st[0] config = exllama.model.ExLlamaConfig(config_path) @@ -237,7 +240,7 @@ if __name__ == "__main__": print("pass: test: Biz/Mynion.py") sys.exit(0) else: - cli = argparse.ArgumentParser() + cli = argparse.ArgumentParser(description=__doc__) cli.add_argument("-u", "--user") cli.add_argument("-p", "--password") cli.add_argument("-m", "--model", choices=MY_MODELS) |