Skip to content

Commit

Permalink
migrated hello world code over
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmerrell committed Apr 27, 2023
1 parent 8f96c70 commit 0bbd353
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
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" ]
21 changes: 21 additions & 0 deletions src/handler.py
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})

0 comments on commit 0bbd353

Please sign in to comment.