[s2s] distributed eval allows num_return_sequences > 1 (#7254)

This commit is contained in:
Sam Shleifer
2020-09-24 17:30:09 -04:00
committed by GitHub
parent 0804d077c6
commit d9d0f1140b
5 changed files with 31 additions and 11 deletions

View File

@@ -456,3 +456,9 @@ def write_txt_file(ordered_tgt, path):
for ln in ordered_tgt:
f.write(ln + "\n")
f.flush()
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i : i + n]