Skip to content

Instantly share code, notes, and snippets.

@zilunpeng
Created March 23, 2021 22:18
Show Gist options
  • Save zilunpeng/c8a55ccdb8df133a2101c08b04ed5151 to your computer and use it in GitHub Desktop.
Save zilunpeng/c8a55ccdb8df133a2101c08b04ed5151 to your computer and use it in GitHub Desktop.
Define the Ray remote method for processing data sample. Code below is part of the distributed inference notebook (https://git.io/JYeQQ).
@ray.remote
def remote_process_data_sample(batch, model, generator, target_dict):
result = process_data_sample(batch, model, generator, target_dict)
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment