Skip to content

Commit

Permalink
Update handler.py
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmerrell committed Oct 28, 2023
1 parent e3d6c54 commit 21ec962
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/handler.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
''' Contains the handler function that will be called by the serverless. '''
""" Example handler file. """

import runpod

# Load models into VRAM here so they can be warm between requests
# If your handler runs inference on a model, load the model here.
# You will want models to be loaded into memory before starting serverless.


def handler(event):
'''
This is the handler function that will be called by the serverless.
'''
print(event)
def handler(job):
""" Handler function that will be used to process jobs. """
job_input = job['input']

# do the things
name = job_input.get('name', 'World')

# return the output that you want to be returned like pre-signed URLs to output artifacts
return "Hello World"
return f"Hello, {name}!"


runpod.serverless.start({"handler": handler})

0 comments on commit 21ec962

Please sign in to comment.