summaryrefslogtreecommitdiff
path: root/convert-hf-to-gguf.py
diff options
context:
space:
mode:
authorGalunid <karolek1231456@gmail.com>2024-05-31 17:42:33 +0200
committerGitHub <noreply@github.com>2024-05-31 17:42:33 +0200
commit0515ad93f48df63bbff204eddb0cac75e8585c65 (patch)
treea4e03bd7a399d9938d9707b9c27ec24f1532383c /convert-hf-to-gguf.py
parentc8047d538f3addab40e3112be60bb92e70ce1a50 (diff)
convert-hf : Handle NotImplementedError in convert-hf-to-gguf (#7660)
Diffstat (limited to 'convert-hf-to-gguf.py')
-rwxr-xr-xconvert-hf-to-gguf.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py
index 9f29cda2..ad071b97 100755
--- a/convert-hf-to-gguf.py
+++ b/convert-hf-to-gguf.py
@@ -2840,7 +2840,12 @@ def main() -> None:
hparams = Model.load_hparams(dir_model)
with torch.inference_mode():
- model_class = Model.from_model_architecture(hparams["architectures"][0])
+ try:
+ model_class = Model.from_model_architecture(hparams["architectures"][0])
+ except NotImplementedError:
+ logger.error(f"Model {hparams['architectures'][0]} is not supported")
+ sys.exit(1)
+
model_instance = model_class(dir_model, ftype_map[args.outtype], fname_out, args.bigendian, args.use_temp_file, args.no_lazy)
logger.info("Set model parameters")