From 09b13acfb25d3f0c46c52663977b6a6cb2b7cae2 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 28 Feb 2024 19:58:21 -0800 Subject: [PATCH] Perplexity evaluation: print to terminal after calculation is finished --- modules/evaluate.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/evaluate.py b/modules/evaluate.py index b78c7b31..35c72689 100644 --- a/modules/evaluate.py +++ b/modules/evaluate.py @@ -127,9 +127,14 @@ def calculate_perplexity(models, input_dataset, stride, _max_length): break ppl = torch.exp(torch.stack(nlls).mean()) + add_entry_to_past_evaluations(float(ppl), shared.model_name, input_dataset, stride, _max_length) save_past_evaluations(past_evaluations) - cumulative_log += f"The perplexity for `{shared.model_name}` is: {float(ppl)}\n\n" + + message = f"The perplexity for `{shared.model_name}` is: {float(ppl)}" + logger.info(message) + + cumulative_log += f"{message}\n\n" yield cumulative_log