Skip to content

Commit df76819

Browse files
committed
error optimization
1 parent 330f3f5 commit df76819

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

fastdeploy/utils.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,9 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
511511
aistudio_download(repo_id=repo_id, revision=revision, local_dir=local_path)
512512
model_name_or_path = local_path
513513
except Exception:
514-
raise Exception(f"The setting model_name_or_path:{model_name_or_path} is not exist.")
514+
raise Exception(
515+
f"The {revision} of {model_name_or_path} is not exist. Please check the model name or revision."
516+
)
515517
elif model_source == "MODELSCOPE":
516518
try:
517519
from modelscope.hub.snapshot_download import (
@@ -526,7 +528,9 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
526528
modelscope_download(repo_id=repo_id, revision=revision, local_dir=local_path)
527529
model_name_or_path = local_path
528530
except Exception:
529-
raise Exception(f"The setting model_name_or_path:{model_name_or_path} is not exist.")
531+
raise Exception(
532+
f"The {revision} of {model_name_or_path} is not exist. Please check the model name or revision."
533+
)
530534
elif model_source == "HUGGINGFACE":
531535
try:
532536
from huggingface_hub._snapshot_download import (
@@ -544,7 +548,9 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
544548
huggingface_download(repo_id=repo_id, revision=revision, local_dir=local_path)
545549
model_name_or_path = local_path
546550
except Exception:
547-
raise Exception(f"The setting model_name_or_path:{model_name_or_path} is not exist.")
551+
raise Exception(
552+
f"The {revision} of {model_name_or_path} is not exist. Please check the model name or revision."
553+
)
548554
else:
549555
raise ValueError(
550556
f"Unsupported model source: {model_source}, please choose one of ['MODELSCOPE', 'AISTUDIO', 'HUGGINGFACE']"

0 commit comments

Comments
 (0)