From 2b7cf9f32bde4c85ce00d6453bf3776dae428a94 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 4 May 2023 00:16:12 +0200 Subject: [PATCH] fix too relaxed model glob (breaking multifile) --- convert.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/convert.py b/convert.py index 245c1915d..474334f6a 100644 --- a/convert.py +++ b/convert.py @@ -1039,7 +1039,12 @@ def load_some_model(path: Path) -> ModelPlus: '''Load a model of any supported format.''' # Be extra-friendly and accept either a file or a directory: if path.is_dir(): - globs = ["consolidated.00.pth", "pytorch_model*.bin", "*.pt"] + globs = [ + "consolidated.00.pth", + "pytorch_model.bin", + "pytorch_model-00001-of-*.bin", + "*.pt" + ] files = [file for glob in globs for file in path.glob(glob)] if not files: # Try GGML too, but with lower priority, since if both a non-GGML