mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-09-01 12:49:50 +08:00
Fix conversion + inference errors.
This commit is contained in:
@@ -19,6 +19,7 @@ def quantize(weights, config, args):
|
||||
|
||||
# Load the model:
|
||||
config.pop("sliding_window", None)
|
||||
config.pop("rope_theta", None)
|
||||
model = Mistral(ModelArgs(**config))
|
||||
weights = tree_map(mx.array, weights)
|
||||
model.update(tree_unflatten(list(weights.items())))
|
||||
|
@@ -196,6 +196,7 @@ def load_model(folder: str):
|
||||
with open(model_path / "config.json", "r") as f:
|
||||
config = json.loads(f.read())
|
||||
config.pop("sliding_window", None)
|
||||
config.pop("rope_theta", None)
|
||||
config.pop("model_type", None)
|
||||
quantization = config.pop("quantization", None)
|
||||
model_args = ModelArgs(**config)
|
||||
|
Reference in New Issue
Block a user