Skip to content

Commit

Permalink
print how long evals take during training (facebookresearch#1895)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexholdenmiller authored Aug 8, 2019
1 parent 9d1d57b commit d624f25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parlai/scripts/train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ def run_eval(valid_worlds, opt, datatype, max_exs=-1, write_log=False):
return None

print('[ running eval: ' + datatype + ' ]')
timer = Timer()
reports = []
for v_world in valid_worlds:
task_report = _run_single_eval(opt, v_world, max_exs / len(valid_worlds))
Expand All @@ -312,7 +313,8 @@ def run_eval(valid_worlds, opt, datatype, max_exs=-1, write_log=False):
reports, tasks, micro=opt.get('aggregate_micro', True)
)

metrics = '{}:{}'.format(datatype, report)
metrics = f'{datatype}:{report}'
print(f'[ eval completed in {timer.time():.2f}s ]')
print(metrics)

# write to file
Expand Down

0 comments on commit d624f25

Please sign in to comment.