File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 1
- ''' Contains the handler function that will be called by the serverless. '''
1
+ """ Example handler file. """
2
2
3
3
import runpod
4
4
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.
6
7
7
8
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' ]
13
12
14
- # do the things
13
+ name = job_input . get ( 'name' , 'World' )
15
14
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 } !"
18
16
19
17
20
18
runpod .serverless .start ({"handler" : handler })
You can’t perform that action at this time.
0 commit comments