@@ -511,9 +511,15 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
511
511
aistudio_download (repo_id = repo_id , revision = revision , local_dir = local_path )
512
512
model_name_or_path = local_path
513
513
except Exception :
514
- raise Exception (
515
- f"The { revision } of { model_name_or_path } is not exist. Please check the model name or revision."
516
- )
514
+ if os .path .exists (model_name_or_path ):
515
+ llm_logger .error (
516
+ "Failed to connect to aistudio, but detected that the model directory exists. Attempting to start."
517
+ )
518
+ return model_name_or_path
519
+ else :
520
+ raise Exception (
521
+ f"The { revision } of { model_name_or_path } is not exist. Please check the model name or revision."
522
+ )
517
523
elif model_source == "MODELSCOPE" :
518
524
try :
519
525
from modelscope .hub .snapshot_download import (
@@ -528,9 +534,15 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
528
534
modelscope_download (repo_id = repo_id , revision = revision , local_dir = local_path )
529
535
model_name_or_path = local_path
530
536
except Exception :
531
- raise Exception (
532
- f"The { revision } of { model_name_or_path } is not exist. Please check the model name or revision."
533
- )
537
+ if os .path .exists (model_name_or_path ):
538
+ llm_logger .error (
539
+ "Failed to connect to modelscope, but detected that the model directory exists. Attempting to start."
540
+ )
541
+ return model_name_or_path
542
+ else :
543
+ raise Exception (
544
+ f"The { revision } of { model_name_or_path } is not exist. Please check the model name or revision."
545
+ )
534
546
elif model_source == "HUGGINGFACE" :
535
547
try :
536
548
from huggingface_hub ._snapshot_download import (
0 commit comments