MCPcopy Create free account
hub / github.com/huggingface/transformers / chunks

Function chunks

examples/seq2seq/run_eval.py:19–22  ·  view source on GitHub ↗

Yield successive n-sized chunks from lst.

(lst, n)

Source from the content-addressed store, hash-verified

17
18
19def chunks(lst, n):
20 """Yield successive n-sized chunks from lst."""
21 for i in range(0, len(lst), n):
22 yield lst[i : i + n]
23
24
25def generate_summaries_or_translations(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected