From 9916294de11bae816c21453b7ea3ba5592ae8494 Mon Sep 17 00:00:00 2001 From: lopho Date: Wed, 16 Nov 2022 22:28:16 +0100 Subject: [PATCH] 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 --- trainer/diffusers_trainer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trainer/diffusers_trainer.py b/trainer/diffusers_trainer.py index bdc712b..1a97c01 100644 --- a/trainer/diffusers_trainer.py +++ b/trainer/diffusers_trainer.py @@ -624,10 +624,12 @@ def main(): if rank == 0: os.makedirs(args.output_path, exist_ok=True) - mode = 'enabled' + mode = 'disabled' if args.enablewandb: - mode = 'disabled' - + 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) # Inform the user of host, and various versions -- useful for debugging issues.