mirror of
https://github.com/modelscope/modelscope.git
synced 2026-07-11 21:09:08 +02:00
move access token to environment variable.
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9681287
* [to #43909247]fix: access token in code, move to environment
19 lines
516 B
Python
19 lines
516 B
Python
import os
|
|
import shutil
|
|
from codecs import ignore_errors
|
|
from os.path import expanduser
|
|
|
|
from modelscope.hub.constants import DEFAULT_CREDENTIALS_PATH
|
|
|
|
# for user citest and sdkdev
|
|
TEST_ACCESS_TOKEN1 = os.environ['TEST_ACCESS_TOKEN_CITEST']
|
|
TEST_ACCESS_TOKEN2 = os.environ['TEST_ACCESS_TOKEN_SDKDEV']
|
|
|
|
TEST_MODEL_CHINESE_NAME = '内部测试模型'
|
|
TEST_MODEL_ORG = 'citest'
|
|
|
|
|
|
def delete_credential():
|
|
path_credential = expanduser(DEFAULT_CREDENTIALS_PATH)
|
|
shutil.rmtree(path_credential, ignore_errors=True)
|