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

Method sameuntil_chunks

test/general/lm_eval/models/gpt3.py:179–190  ·  view source on GitHub ↗
(xs, size)

Source from the content-addressed store, hash-verified

177 re_ord = utils.Reorderer(requests, _collate)
178
179 def sameuntil_chunks(xs, size):
180 ret = []
181 lastuntil = xs[0][1]
182 for x in xs:
183 if len(ret) >= size or x[1] != lastuntil:
184 yield ret, lastuntil
185 ret = []
186 lastuntil = x[1]
187 ret.append(x)
188
189 if ret:
190 yield ret, lastuntil
191
192 # todo: more intelligent batching for heterogeneous `until`
193 for chunk, until in tqdm(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected