Browse Source

[to #43776187] fix: fix token file name modify issue.

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9623747

    * [to #43776187]fix: fix git credminal file name change
master
mulin.lyh 3 years ago
parent
commit
0555a79693
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      modelscope/hub/api.py

+ 2
- 3
modelscope/hub/api.py View File

@@ -419,8 +419,7 @@ class ModelScopeConfig:
ModelScopeConfig.make_sure_credential_path_exist()
with open(
os.path.join(ModelScopeConfig.path_credential,
ModelScopeConfig.GITLAB_TOKEN_FILE_NAME),
'w+') as f:
ModelScopeConfig.GIT_TOKEN_FILE_NAME), 'w+') as f:
f.write(token)

@staticmethod
@@ -457,7 +456,7 @@ class ModelScopeConfig:
try:
with open(
os.path.join(ModelScopeConfig.path_credential,
ModelScopeConfig.GITLAB_TOKEN_FILE_NAME),
ModelScopeConfig.GIT_TOKEN_FILE_NAME),
'r') as f:
token = f.read()
except FileNotFoundError:


Loading…
Cancel
Save