Skip to content

Commit

Permalink
Update evaluation.py | Output GPTJ accuracy metric as string (#1886)
Browse files Browse the repository at this point in the history
* Update evaluation.py | Output GPTJ accuracy metric as string

Fixes #1885

* [Automated Commit] Format Codebase
  • Loading branch information
arjunsuresh authored Oct 29, 2024
1 parent 82101bb commit c72a59f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion language/gpt-j/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def main():
result = metric.compute(
predictions=preds, references=targets, use_stemmer=True, use_aggregator=False
)
result = {k: round(np.mean(v) * 100, 4) for k, v in result.items()}
result = {k: f"{round(np.mean(v) * 100, 4)}" for k, v in result.items()}
prediction_lens = [len(pred) for pred in preds]
result["gen_len"] = np.sum(prediction_lens)
result["gen_num"] = len(preds)
Expand Down

0 comments on commit c72a59f

Please sign in to comment.