-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3d6c54
commit 21ec962
Showing
1 changed file
with
8 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |