MCPcopy Create free account
hub / github.com/modelscope/modelscope / read_in_chunks

Method read_in_chunks

modelscope/hub/utils/aigc.py:348–356  ·  view source on GitHub ↗
(file_object,
                           pbar,
                           chunk_size: int = 1 * 1024 * 1024)

Source from the content-addressed store, hash-verified

346 file_size = os.path.getsize(file_path)
347
348 def read_in_chunks(file_object,
349 pbar,
350 chunk_size: int = 1 * 1024 * 1024):
351 while True:
352 ck = file_object.read(chunk_size)
353 if not ck:
354 break
355 pbar.update(len(ck))
356 yield ck
357
358 with tqdm(
359 total=file_size,

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected