diff --git a/modelscope/hub/api.py b/modelscope/hub/api.py index e6160492..747cf242 100644 --- a/modelscope/hub/api.py +++ b/modelscope/hub/api.py @@ -1783,12 +1783,11 @@ class ModelScopeConfig: with open(cookies_path, 'rb') as f: cookies = pickle.load(f) for cookie in cookies: - if cookie.is_expired() and not ModelScopeConfig.cookie_expired_warning: + if cookie.name == 'm_session_id' and cookie.is_expired() and \ + not ModelScopeConfig.cookie_expired_warning: ModelScopeConfig.cookie_expired_warning = True - logger.debug( - 'Authentication has expired, ' - 'please re-login with modelscope login --token "YOUR_SDK_TOKEN" ' - 'if you need to access private models or datasets.') + logger.warning('Authentication has expired, ' + 'please re-login for uploading or accessing controlled entities.') return None return cookies return None