Просмотр исходного кода

Update download_model.py

download models with modelscope
liferecords 3 месяцев назад
Родитель
Сommit
948f1c2a06
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      tools/download_model.py

+ 6 - 1
tools/download_model.py

@@ -15,5 +15,10 @@ if __name__ == '__main__':
     if args.type == "huggingface":
         from huggingface_hub import snapshot_download
         snapshot_download(repo_id=args.name, local_dir=model_dir, local_dir_use_symlinks=False, resume_download=True)
+    elif args.type == "modelscope":
+        from modelscope import snapshot_download
+        snapshot_download(repo_id=args.name, local_dir=model_dir)
+    else:
+        raise ValueError(f"Invalid type: {args.type}")
     
-    print(f"model downloaded to {model_dir}")
+    print(f"model downloaded to {model_dir}")