diff --git a/modelscope/hub/api.py b/modelscope/hub/api.py index fa275258..34565193 100644 --- a/modelscope/hub/api.py +++ b/modelscope/hub/api.py @@ -718,10 +718,12 @@ class HubApi: def get_valid_revision(self, model_id: str, revision=None, - cookies: Optional[CookieJar] = None): + cookies: Optional[CookieJar] = None, + endpoint: Optional[str] = None): return self.get_valid_revision_detail(model_id=model_id, revision=revision, - cookies=cookies)['Revision'] + cookies=cookies, + endpoint=endpoint)['Revision'] def get_model_branches_and_tags_details( self, diff --git a/modelscope/hub/file_download.py b/modelscope/hub/file_download.py index 190c6ac6..da467463 100644 --- a/modelscope/hub/file_download.py +++ b/modelscope/hub/file_download.py @@ -359,8 +359,10 @@ def create_temporary_directory_and_cache(model_id: str, return temporary_cache_dir, cache -def get_file_download_url(model_id: str, file_path: str, revision: str, - endpoint: str): +def get_file_download_url(model_id: str, + file_path: str, + revision: str, + endpoint: Optional[str] = None): """Format file download url according to `model_id`, `revision` and `file_path`. e.g., Given `model_id=john/bert`, `revision=master`, `file_path=README.md`, the resulted download url is: https://modelscope.cn/api/v1/models/john/bert/repo?Revision=master&FilePath=README.md