@@ -531,16 +531,16 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
531
531
local_path = f"{ local_path } /{ repo_id } "
532
532
aistudio_download (repo_id = repo_id , revision = revision , local_dir = local_path )
533
533
model_name_or_path = local_path
534
- except Exception :
534
+ except requests . exceptions . ConnectTimeout :
535
535
if os .path .exists (local_path ):
536
536
llm_logger .error (
537
537
f"Failed to connect to aistudio, but detected that the model directory { local_path } exists. Attempting to start."
538
538
)
539
539
return local_path
540
- else :
541
- raise Exception (
542
- f"The { revision } of { model_name_or_path } is not exist. Please check the model name or revision."
543
- )
540
+ except Exception :
541
+ raise Exception (
542
+ f"The { revision } of { model_name_or_path } is not exist. Please check the model name or revision."
543
+ )
544
544
elif model_source == "MODELSCOPE" :
545
545
try :
546
546
from modelscope .hub .snapshot_download import (
@@ -554,6 +554,12 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
554
554
local_path = f"{ local_path } /{ repo_id } "
555
555
modelscope_download (repo_id = repo_id , revision = revision , local_dir = local_path )
556
556
model_name_or_path = local_path
557
+ except requests .exceptions .ConnectTimeout :
558
+ if os .path .exists (local_path ):
559
+ llm_logger .error (
560
+ f"Failed to connect to modelscope, but detected that the model directory { local_path } exists. Attempting to start."
561
+ )
562
+ return local_path
557
563
except Exception :
558
564
raise Exception (
559
565
f"The { revision } of { model_name_or_path } is not exist. Please check the model name or revision."
0 commit comments