(file_object,
pbar,
chunk_size: int = 1 * 1024 * 1024)
| 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, |