-
Notifications
You must be signed in to change notification settings - Fork 63
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
8f96c70
commit 0bbd353
Showing
2 changed files
with
30 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from python:3.11.1-buster | ||
|
||
WORKDIR / | ||
|
||
RUN pip install runpod | ||
|
||
ADD src/handler.py . | ||
|
||
CMD [ "python", "-u", "/handler.py" ] |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python | ||
''' Contains the handler function that will be called by the serverless. ''' | ||
|
||
import runpod | ||
|
||
# Load models into VRAM here so they can be warm between requests | ||
|
||
|
||
def handler(event): | ||
''' | ||
This is the handler function that will be called by the serverless. | ||
''' | ||
print(event) | ||
|
||
# do the things | ||
|
||
# return the output that you want to be returned like pre-signed URLs to output artifacts | ||
return "Hello World" | ||
|
||
|
||
runpod.serverless.start({"handler": handler}) |