Skip to content

Instantly share code, notes, and snippets.

@JoshBroomberg
Created August 7, 2017 00:03
Show Gist options
  • Save JoshBroomberg/242b34a6af945ae4834362ff7a2b6974 to your computer and use it in GitHub Desktop.
Save JoshBroomberg/242b34a6af945ae4834362ff7a2b6974 to your computer and use it in GitHub Desktop.
@celery.task
def async_training_task(data_file_name, k_iterations):
train_model(file=data_file_name, iterations=k_iterations)
# This is the standard flask handler.
# Maybe you get some params from the request/
def get(self, request):
async_training_task.delay(data_file_name=request.file_name, iterations=10)
return Response("Training has been started!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment