cleanup hf login

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-10-02 08:17:32 -04:00
parent 435ec70f60
commit f245506bf2
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -22,6 +22,7 @@ pbar = None
def hf_login(token=None):
global loggedin # pylint: disable=global-statement
token = token or shared.opts.huggingface_token
token = token.replace("\n", "").replace("\r", "").strip() if token is not None else None
install('hf_xet', quiet=True)
if token is None or len(token) <= 4:
log.debug('HF login: no token provided')
+1 -1
View File
@@ -1220,9 +1220,9 @@ def hf_auth_check(checkpoint_info, force:bool=False):
return True
except Exception:
pass
repo_id = path_to_repo(checkpoint_info)
try:
login = modelloader.hf_login()
repo_id = path_to_repo(checkpoint_info)
return hf.auth_check(repo_id)
except Exception as e:
shared.log.error(f'Load model: repo="{repo_id}" login={login} {e}')