prevent crashes on quick install when hftoken not defined

This commit is contained in:
Lincoln Stein 2023-07-20 08:38:37 -04:00
parent 4d8f17c69d
commit cb29ac63a8

View File

@ -663,7 +663,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 opts.hf_token:
if hasattr(opts,'hf_token'):
HfLogin(opts.hf_token)
# -------------------------------------