Skip to content

Instantly share code, notes, and snippets.

@zilunpeng
Created March 23, 2021 22:21
Show Gist options
  • Save zilunpeng/8aea95fea9536814670fe69edde79337 to your computer and use it in GitHub Desktop.
Save zilunpeng/8aea95fea9536814670fe69edde79337 to your computer and use it in GitHub Desktop.
Process every data sample using Ray. Code below is part of the distributed inference notebook (https://git.io/JYeQQ).
prediction_futures, ground_truths = [], []
for i, batch in enumerate(data_loader):
prediction_future = remote_process_batch_element.remote(batch, model_id, decoder_id, target_dict)
prediction_futures.append(prediction_future)
ground_truths.append(batch[2][0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment