From 9318d99b9c01f5c7a84f28bc52475a8bc579e685 Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Wed, 20 Dec 2023 17:05:27 +0100 Subject: [PATCH] Use config.json, add model_type --- mistral/mistral.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mistral/mistral.py b/mistral/mistral.py index 0c3976c1..11dcface 100644 --- a/mistral/mistral.py +++ b/mistral/mistral.py @@ -192,9 +192,10 @@ class Tokenizer: def load_model(folder: str, dtype=mx.float16): model_path = Path(folder) tokenizer = Tokenizer(str(model_path / "tokenizer.model")) - with open(model_path / "params.json", "r") as f: + with open(model_path / "config.json", "r") as f: config = json.loads(f.read()) - config.pop("sliding_window") + config.pop("sliding_window", None) + config.pop("model_type", None) model_args = ModelArgs(**config) weights = mx.load(str(model_path / "weights.npz")) weights = tree_unflatten(list(weights.items()))