Skip to content

Commit 9b3be8b

Browse files
authored
Fix handler packages (#298)
1 parent 9b83927 commit 9b3be8b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/workloads/cortex/onnx_serve/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def start(args):
226226

227227
local_cache["api"] = api
228228
local_cache["ctx"] = ctx
229-
if api.get("request_handler_impl_key") is not None:
229+
if api.get("request_handler") is not None:
230230
package.install_packages(ctx.python_packages, ctx.storage)
231231
local_cache["request_handler"] = ctx.get_request_handler_impl(api["name"])
232232

pkg/workloads/cortex/tf_api/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,16 +447,16 @@ def start(args):
447447
local_cache["ctx"] = ctx
448448

449449
try:
450-
if api.get("request_handler_impl_key") is not None:
450+
if api.get("request_handler") is not None or util.is_resource_ref(api["model"]):
451+
package.install_packages(ctx.python_packages, ctx.storage)
452+
453+
if api.get("request_handler") is not None:
451454
local_cache["request_handler"] = ctx.get_request_handler_impl(api["name"])
452455

453456
if not util.is_resource_ref(api["model"]):
454-
if api.get("request_handler") is not None:
455-
package.install_packages(ctx.python_packages, ctx.storage)
456457
if not os.path.isdir(args.model_dir):
457458
ctx.storage.download_and_unzip_external(api["model"], args.model_dir)
458459
else:
459-
package.install_packages(ctx.python_packages, ctx.storage)
460460
model_name = util.get_resource_ref(api["model"])
461461
model = ctx.models[model_name]
462462
estimator = ctx.estimators[model["estimator"]]

0 commit comments

Comments
 (0)