Skip to content

Commit 9d00bfa

Browse files
authored
Merge pull request #226 from EvolvingLMMs-Lab/dev/quick-fix-wandb
fix: fix wrong args in wandb logger
2 parents 146002c + 5b310f4 commit 9d00bfa

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

lmms_eval/__main__.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,20 +321,22 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
321321

322322
for args in args_list:
323323
try:
324-
if is_main_process and args.wandb_args: # thoughtfully we should only init wandb once, instead of multiple ranks to avoid network traffics and unwanted behaviors.
325-
wandb_logger = WandbLogger(args)
324+
# if is_main_process and args.wandb_args: # thoughtfully we should only init wandb once, instead of multiple ranks to avoid network traffics and unwanted behaviors.
325+
# wandb_logger = WandbLogger()
326326

327327
results, samples = cli_evaluate_single(args)
328328
results_list.append(results)
329329

330330
accelerator.wait_for_everyone()
331331
if is_main_process and args.wandb_args:
332-
wandb_logger.post_init(results)
333-
wandb_logger.log_eval_result()
334-
if args.wandb_log_samples and samples is not None:
335-
wandb_logger.log_eval_samples(samples)
336-
337-
wandb_logger.finish()
332+
try:
333+
wandb_logger.post_init(results)
334+
wandb_logger.log_eval_result()
335+
if args.wandb_log_samples and samples is not None:
336+
wandb_logger.log_eval_samples(samples)
337+
except Exception as e:
338+
eval_logger.info(f"Logging to Weights and Biases failed due to {e}")
339+
# wandb_logger.finish()
338340

339341
except Exception as e:
340342
if args.verbosity == "DEBUG":
@@ -349,6 +351,9 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
349351
if results is not None:
350352
print_results(args, results)
351353

354+
if args.wandb_args:
355+
wandb_logger.run.finish()
356+
352357

353358
def cli_evaluate_single(args: Union[argparse.Namespace, None] = None) -> None:
354359
selected_task_list = args.tasks.split(",") if args.tasks else None

0 commit comments

Comments
 (0)