[Feature] multi source download (#3072)

* multi-source download

* multi-source download

* huggingface download revision

* requirement

* style

* add revision arg

* test

* pre-commit

* Change default download

* change requirements.txt

* modify English Documentation

* documentation

* modify model download path
This commit is contained in:
Yzc216
2025-07-30 14:10:13 +08:00
committed by GitHub
parent 4dc130c5a9
commit 159767717d

View File

@@ -507,7 +507,7 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
repo_id = "PaddlePaddle" + repo_id.strip()[5:]
if local_path is None:
local_path = f'{os.getenv("HOME")}'
local_path = f"{local_path}/{repo_id}/{revision}"
local_path = f"{local_path}/{repo_id}"
aistudio_download(repo_id=repo_id, revision=revision, local_dir=local_path)
model_name_or_path = local_path
except Exception:
@@ -522,7 +522,7 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
repo_id = "PaddlePaddle" + repo_id.strip()[5:]
if local_path is None:
local_path = f'{os.getenv("HOME")}'
local_path = f"{local_path}/{repo_id}/{revision}"
local_path = f"{local_path}/{repo_id}"
modelscope_download(repo_id=repo_id, revision=revision, local_dir=local_path)
model_name_or_path = local_path
except Exception:
@@ -540,7 +540,7 @@ def retrive_model_from_server(model_name_or_path, revision="master"):
repo_id = "baidu" + repo_id.strip()[12:]
if local_path is None:
local_path = f'{os.getenv("HOME")}'
local_path = f"{local_path}/{repo_id}/{revision}"
local_path = f"{local_path}/{repo_id}"
huggingface_download(repo_id=repo_id, revision=revision, local_dir=local_path)
model_name_or_path = local_path
except Exception: