MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / chunks

Function chunks

test/general/lm_eval/utils.py:68–77  ·  view source on GitHub ↗
(iter, n=0, fn=None)

Source from the content-addressed store, hash-verified

66
67
68def chunks(iter, n=0, fn=None):
69 arr = []
70 for i, x in enumerate(iter):
71 arr.append(x)
72 if len(arr) == (fn(i) if fn else n):
73 yield arr
74 arr = []
75
76 if arr:
77 yield arr
78
79
80def group(arr, fn):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected