Skip to content

Commit aaa018f

Browse files
author
Justin Merrell
committed
fix: remove infer need
1 parent 7fe272b commit aaa018f

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

runpod/serverless/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from . import pod_worker
44

55

6-
def start():
6+
def start(config):
77
'''
88
Starts the serverless worker.
99
'''
10-
pod_worker.start_worker()
10+
pod_worker.start_worker(config)

runpod/serverless/modules/job.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import requests
77

88
from .logging import log
9-
from . import inference
9+
# from . import inference
1010

1111

1212
def get(worker_id):
@@ -51,17 +51,19 @@ def get(worker_id):
5151
return None
5252

5353

54-
def run(job):
54+
def run(job, run_handler):
5555
'''
5656
Run the job.
5757
Returns list of URLs and Job Time
5858
'''
5959
time_job_started = time.time()
6060
log(f"Started working on {job['id']} at {time_job_started} UTC")
6161

62-
model = inference.Model()
62+
# model = inference.Model()
63+
64+
# job_output = model.run(job)
65+
job_output = run_handler(job)
6366

64-
job_output = model.run(job)
6567
log(f"Job output: {job_output}")
6668

6769
for index, output in enumerate(job_output):

runpod/serverless/pod_worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .modules.logging import log
1111

1212

13-
def start_worker():
13+
def start_worker(config):
1414
'''
1515
Starts the worker.
1616
'''
@@ -30,7 +30,7 @@ def start_worker():
3030
job.error(worker_life.worker_id, next_job['id'], "No input provided.")
3131
continue
3232

33-
job_results = job.run(next_job)
33+
job_results = job.run(next_job, config['handler'])
3434

3535
if 'error' in job_results:
3636
job.error(worker_life.worker_id, next_job['id'], job_results['error'])

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = runpod
3-
version = 0.4.6
3+
version = 0.5.0
44
description = Official Python library for RunPod API & SDK.
55
long_description = file: README.md
66
long_description_content_type = text/markdown

0 commit comments

Comments
 (0)