Skip to content

Commit

Permalink
switch back to torchmetrics.text.Perplexity
Browse files Browse the repository at this point in the history
  • Loading branch information
sichu2023 committed Dec 27, 2024
1 parent cb3de59 commit 4c77f97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sub-packages/bionemo-llm/src/bionemo/llm/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,11 @@ def __init__(
self.log_train_ppl = log_train_ppl
self.log_val_ppl = log_val_ppl
if log_train_ppl:
self.train_ppl = MegatronPerplexityMetric(ignore_index=-100)
# self.train_ppl = MegatronPerplexityMetric(ignore_index=-100)
self.train_ppl = torchmetrics.text.Perplexity(ignore_index=-100)
if log_val_ppl:
self.valid_ppl = MegatronPerplexityMetric(ignore_index=-100)
# self.valid_ppl = MegatronPerplexityMetric(ignore_index=-100)
self.valid_ppl = torchmetrics.text.Perplexity(ignore_index=-100)

def configure_model(self) -> None:
"""Updates internal state: instantiates the model from the object's config, assigns to `model` attribute.
Expand Down

0 comments on commit 4c77f97

Please sign in to comment.