mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-29 18:26:37 +08:00
Allow converting models from local directories (#1118)
This commit is contained in:
parent
9960d47d10
commit
a0c11fe91d
@ -174,11 +174,6 @@ def load_torch_weights_and_config(
|
|||||||
"*.txt",
|
"*.txt",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
raise RuntimeError(
|
|
||||||
f"Model {name_or_path} is not found in {available_models()},"
|
|
||||||
"on Hugging Face or as a local path."
|
|
||||||
)
|
|
||||||
|
|
||||||
if name_or_path.endswith(".pt"):
|
if name_or_path.endswith(".pt"):
|
||||||
checkpoint = torch.load(name_or_path, map_location="cpu", weights_only=False)
|
checkpoint = torch.load(name_or_path, map_location="cpu", weights_only=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user