Skip to content

Commit 0515ad9

Browse files
authored
convert-hf : Handle NotImplementedError in convert-hf-to-gguf (#7660)
1 parent c8047d5 commit 0515ad9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

convert-hf-to-gguf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2840,7 +2840,12 @@ def main() -> None:
28402840
hparams = Model.load_hparams(dir_model)
28412841

28422842
with torch.inference_mode():
2843-
model_class = Model.from_model_architecture(hparams["architectures"][0])
2843+
try:
2844+
model_class = Model.from_model_architecture(hparams["architectures"][0])
2845+
except NotImplementedError:
2846+
logger.error(f"Model {hparams['architectures'][0]} is not supported")
2847+
sys.exit(1)
2848+
28442849
model_instance = model_class(dir_model, ftype_map[args.outtype], fname_out, args.bigendian, args.use_temp_file, args.no_lazy)
28452850

28462851
logger.info("Set model parameters")

0 commit comments

Comments
 (0)