mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-24 08:56:52 +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
|
break
|
||||||
|
|
||||||
ppl = torch.exp(torch.stack(nlls).mean())
|
ppl = torch.exp(torch.stack(nlls).mean())
|
||||||
|
|
||||||
add_entry_to_past_evaluations(float(ppl), shared.model_name, input_dataset, stride, _max_length)
|
add_entry_to_past_evaluations(float(ppl), shared.model_name, input_dataset, stride, _max_length)
|
||||||
save_past_evaluations(past_evaluations)
|
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
|
yield cumulative_log
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user