From 80ccd58d6154fad283a42492c473e4b97b72166d Mon Sep 17 00:00:00 2001 From: "xingjun.wxj" Date: Mon, 3 Mar 2025 17:30:42 +0800 Subject: [PATCH] update --- modelscope/hub/api.py | 4 +++- modelscope/utils/repo_utils.py | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/modelscope/hub/api.py b/modelscope/hub/api.py index e2a5c137..8d9b35af 100644 --- a/modelscope/hub/api.py +++ b/modelscope/hub/api.py @@ -1289,6 +1289,8 @@ class HubApi: commit_message = commit_message or f'Commit to {repo_id}' commit_description = commit_description or '' + print(f'>>url: {url}, >>commit_message: {commit_message}, >>commit_description: {commit_description}') + self.login(access_token=token) # Construct payload @@ -1297,7 +1299,7 @@ class HubApi: commit_message=commit_message, ) - print(f'Got payload: {payload}') + print(f'>> Got payload: {payload}') # POST cookies = ModelScopeConfig.get_cookies() diff --git a/modelscope/utils/repo_utils.py b/modelscope/utils/repo_utils.py index 85ddc2f7..2958bc1c 100644 --- a/modelscope/utils/repo_utils.py +++ b/modelscope/utils/repo_utils.py @@ -244,14 +244,14 @@ class CommitInfo(str): Url to the PR that has been created, if any. Populated when `create_pr=True` is passed. - pr_revision (`str`, *optional*): - Revision of the PR that has been created, if any. Populated when - `create_pr=True` is passed. Example: `"refs/pr/1"`. + # pr_revision (`str`, *optional*): + # Revision of the PR that has been created, if any. Populated when + # `create_pr=True` is passed. Example: `"refs/pr/1"`. - pr_num (`int`, *optional*): - Number of the PR discussion that has been created, if any. Populated when - `create_pr=True` is passed. Can be passed as `discussion_num` in - [`get_discussion_details`]. Example: `1`. + # pr_num (`int`, *optional*): + # Number of the PR discussion that has been created, if any. Populated when + # `create_pr=True` is passed. Can be passed as `discussion_num` in + # [`get_discussion_details`]. Example: `1`. _url (`str`, *optional*): Legacy url for `str` compatibility. Can be the url to the uploaded file on the Hub (if returned by @@ -267,8 +267,8 @@ class CommitInfo(str): pr_url: Optional[str] = None # Computed from `pr_url` in `__post_init__` - pr_revision: Optional[str] = field(init=False) - pr_num: Optional[str] = field(init=False) + # pr_revision: Optional[str] = field(init=False) + # pr_num: Optional[str] = field(init=False) # legacy url for `str` compatibility (ex: url to uploaded file, url to uploaded folder, url to PR, etc.) _url: str = field(