Skip to content

Commit 2caafc0

Browse files
committed
连接失败兜底
1 parent 855e952 commit 2caafc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fastdeploy/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,11 @@ 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-
if os.path.exists(model_name_or_path):
514+
if os.path.exists(local_path):
515515
llm_logger.error(
516516
"Failed to connect to aistudio, but detected that the model directory exists. Attempting to start."
517517
)
518-
return model_name_or_path
518+
return local_path
519519
else:
520520
raise Exception(
521521
f"The {revision} of {model_name_or_path} is not exist. Please check the model name or revision."
@@ -534,11 +534,11 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
534534
modelscope_download(repo_id=repo_id, revision=revision, local_dir=local_path)
535535
model_name_or_path = local_path
536536
except Exception:
537-
if os.path.exists(model_name_or_path):
537+
if os.path.exists(local_path):
538538
llm_logger.error(
539539
"Failed to connect to modelscope, but detected that the model directory exists. Attempting to start."
540540
)
541-
return model_name_or_path
541+
return local_path
542542
else:
543543
raise Exception(
544544
f"The {revision} of {model_name_or_path} is not exist. Please check the model name or revision."

0 commit comments

Comments
 (0)