mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-29 18:26:37 +08:00
update
This commit is contained in:
parent
9d86b5b744
commit
5c535a28c0
@ -17,6 +17,7 @@ from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Type,
|
|||||||
import mlx.core as mx
|
import mlx.core as mx
|
||||||
import mlx.nn as nn
|
import mlx.nn as nn
|
||||||
if os.getenv('MLX_USE_MODELSCOPE', 'False').lower() == 'true':
|
if os.getenv('MLX_USE_MODELSCOPE', 'False').lower() == 'true':
|
||||||
|
print(">> Using ModelScope")
|
||||||
from modelscope import snapshot_download
|
from modelscope import snapshot_download
|
||||||
else:
|
else:
|
||||||
from huggingface_hub import snapshot_download
|
from huggingface_hub import snapshot_download
|
||||||
@ -157,6 +158,10 @@ def get_model_path(path_or_hf_repo: str, revision: Optional[str] = None) -> Path
|
|||||||
Path: The path to the model.
|
Path: The path to the model.
|
||||||
"""
|
"""
|
||||||
model_path = Path(path_or_hf_repo)
|
model_path = Path(path_or_hf_repo)
|
||||||
|
print(f'>>model_path: {model_path}')
|
||||||
|
revision = revision or 'master'
|
||||||
|
print(f'>>revision: {revision}')
|
||||||
|
|
||||||
if not model_path.exists():
|
if not model_path.exists():
|
||||||
try:
|
try:
|
||||||
model_path = Path(
|
model_path = Path(
|
||||||
|
Loading…
Reference in New Issue
Block a user