mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-29 21:50:16 +01:00
Perplexity evaluation: print to terminal after calculation is finished
This commit is contained in:
parent
332957ffec
commit
09b13acfb2
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user