[s2s] round runtime in run_eval (#6798)

This commit is contained in:
Sam Shleifer
2020-08-29 17:36:31 -04:00
committed by GitHub
parent 5ab21b072f
commit ac47458a02

View File

@@ -67,7 +67,7 @@ def generate_summaries_or_translations(
fout.write(hypothesis + "\n") fout.write(hypothesis + "\n")
fout.flush() fout.flush()
fout.close() fout.close()
runtime = time.time() - start_time runtime = int(time.time() - start_time) # seconds
n_obs = len(examples) n_obs = len(examples)
return dict(n_obs=n_obs, runtime=runtime, seconds_per_sample=round(runtime / n_obs, 4)) return dict(n_obs=n_obs, runtime=runtime, seconds_per_sample=round(runtime / n_obs, 4))