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