Commit 44d7b2fa authored by Leo Gao's avatar Leo Gao
Browse files

Merge branch 'master' of github.com:EleutherAI/lm_evaluation_harness

parents 310ca7a8 c4632655
......@@ -2,3 +2,4 @@ env
*.pyc
data/
lm_cache
.idea
\ No newline at end of file
import math
from collections import Iterable
from pprint import pprint
import numpy as np
import sacrebleu
......@@ -124,7 +125,7 @@ def _sacreformat(refs, preds):
# Must become List[List[str]] with the inner list corresponding to preds
if not is_non_str_iterable(refs):
refs = list(refs)
if not is_non_str_iterable(refs):
if not is_non_str_iterable(refs[0]):
refs = [[ref] for ref in refs]
refs = list(zip(*refs))
# Note the number of refs in each ref list much match the number of preds
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment