Skip to content

Commit

Permalink
waiting for every process
Browse files Browse the repository at this point in the history
  • Loading branch information
lmeribal committed Sep 11, 2024
1 parent 40241cc commit 70bfd2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions turbo_alignment/pipelines/preprocessing/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def _async_process_files(self, reader, encoder, files_paths, experiment_settings
for i, batch in enumerate(tqdm(batches)):
try:
logger.info(f'📖 Processing batch {i} / {len(batches)}')
self.accelerator.wait_for_everyone()
batch_output = self._process_function(reader, encoder, batch, experiment_settings, i)
self.accelerator.wait_for_everyone()
for filename, encoded_output in batch_output.items():
torch.save(
encoded_output,
Expand All @@ -78,6 +80,7 @@ def _async_process_files(self, reader, encoder, files_paths, experiment_settings
+ '.pt'
),
)
self.accelerator.wait_for_everyone()
except Exception as exc:
logger.error(f'Error reading file: {exc}')

Expand Down

0 comments on commit 70bfd2e

Please sign in to comment.