Skip to content

Commit

Permalink
fix: remove np type around output values (#1764)
Browse files Browse the repository at this point in the history
fixes #1763
  • Loading branch information
viraatc committed Jul 3, 2024
1 parent 29edbb0 commit 4a77003
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions language/mixtral-8x7b/evaluate-accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def main():
if preds:
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: float(round(np.mean(v) * 100, 4)) for k, v in result.items()}
prediction_lens = [len(pred) for pred in preds]

else:
Expand Down Expand Up @@ -212,7 +212,7 @@ def main():

result = {
**result,
'gen_len': np.sum(prediction_lens),
'gen_len': int(np.sum(prediction_lens)),
'gen_num': gen_num,
'gen_tok_len': gen_tok_len,
'tokens_per_sample': round(gen_tok_len / gen_num, 1),
Expand Down

0 comments on commit 4a77003

Please sign in to comment.