fix wandb init mode, don't log hf token

correct value for mode ('enabled' is invalid)
clear hf_token passed to wandb to avoid logging it
This commit is contained in:
lopho 2022-11-16 22:28:16 +01:00 committed by GitHub
parent c8eeaaf353
commit 9916294de1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -624,10 +624,12 @@ def main():
if rank == 0: if rank == 0:
os.makedirs(args.output_path, exist_ok=True) os.makedirs(args.output_path, exist_ok=True)
mode = 'enabled'
if args.enablewandb:
mode = 'disabled' mode = 'disabled'
if args.enablewandb:
mode = 'online'
if args.hf_token is not None:
os.environ['HF_API_TOKEN'] = args.hf_token
args.hf_token = None
run = wandb.init(project=args.project_id, name=args.run_name, config=vars(args), dir=args.output_path+'/wandb', mode=mode) run = wandb.init(project=args.project_id, name=args.run_name, config=vars(args), dir=args.output_path+'/wandb', mode=mode)
# Inform the user of host, and various versions -- useful for debugging issues. # Inform the user of host, and various versions -- useful for debugging issues.