mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-24 01:17:28 +08:00
Allow converting models from local directories (#1118)
This commit is contained in:
parent
0ffdb6dd20
commit
adaab81029
@ -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