Skip to content

Commit 21ec962

Browse files
committed
Update handler.py
1 parent e3d6c54 commit 21ec962

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/handler.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
''' Contains the handler function that will be called by the serverless. '''
1+
""" Example handler file. """
22

33
import runpod
44

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

78

8-
def handler(event):
9-
'''
10-
This is the handler function that will be called by the serverless.
11-
'''
12-
print(event)
9+
def handler(job):
10+
""" Handler function that will be used to process jobs. """
11+
job_input = job['input']
1312

14-
# do the things
13+
name = job_input.get('name', 'World')
1514

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

1917

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

0 commit comments

Comments
 (0)