extra check for empty hftoken

This commit is contained in:
Lincoln Stein 2023-07-20 15:16:06 -04:00
parent c013fe5b5d
commit 85ef3f51e7

View File

@ -661,7 +661,7 @@ def write_opts(opts: Namespace, init_file: Path):
with open(init_file,'w', encoding='utf-8') as file:
file.write(new_config.to_yaml())
if hasattr(opts,'hf_token'):
if hasattr(opts,'hf_token') and opts.hf_token:
HfLogin(opts.hf_token)
# -------------------------------------