File tree Expand file tree Collapse file tree 4 files changed +11
-9
lines changed Expand file tree Collapse file tree 4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 3
3
from . import pod_worker
4
4
5
5
6
- def start ():
6
+ def start (config ):
7
7
'''
8
8
Starts the serverless worker.
9
9
'''
10
- pod_worker .start_worker ()
10
+ pod_worker .start_worker (config )
Original file line number Diff line number Diff line change 6
6
import requests
7
7
8
8
from .logging import log
9
- from . import inference
9
+ # from . import inference
10
10
11
11
12
12
def get (worker_id ):
@@ -51,17 +51,19 @@ def get(worker_id):
51
51
return None
52
52
53
53
54
- def run (job ):
54
+ def run (job , run_handler ):
55
55
'''
56
56
Run the job.
57
57
Returns list of URLs and Job Time
58
58
'''
59
59
time_job_started = time .time ()
60
60
log (f"Started working on { job ['id' ]} at { time_job_started } UTC" )
61
61
62
- model = inference .Model ()
62
+ # model = inference.Model()
63
+
64
+ # job_output = model.run(job)
65
+ job_output = run_handler (job )
63
66
64
- job_output = model .run (job )
65
67
log (f"Job output: { job_output } " )
66
68
67
69
for index , output in enumerate (job_output ):
Original file line number Diff line number Diff line change 10
10
from .modules .logging import log
11
11
12
12
13
- def start_worker ():
13
+ def start_worker (config ):
14
14
'''
15
15
Starts the worker.
16
16
'''
@@ -30,7 +30,7 @@ def start_worker():
30
30
job .error (worker_life .worker_id , next_job ['id' ], "No input provided." )
31
31
continue
32
32
33
- job_results = job .run (next_job )
33
+ job_results = job .run (next_job , config [ 'handler' ] )
34
34
35
35
if 'error' in job_results :
36
36
job .error (worker_life .worker_id , next_job ['id' ], job_results ['error' ])
Original file line number Diff line number Diff line change 1
1
[metadata]
2
2
name = runpod
3
- version = 0.4.6
3
+ version = 0.5.0
4
4
description = Official Python library for RunPod API & SDK.
5
5
long_description = file: README.md
6
6
long_description_content_type = text/markdown
You can’t perform that action at this time.
0 commit comments