Skip to content

Commit a3976b9

Browse files
vishalbolludeliahu
authored andcommitted
Fix bug in multi input ONNX model (#543)
(cherry picked from commit a6bdb5f)
1 parent 0f1d44f commit a3976b9

File tree

1 file changed

+4
-2
lines changed
  • pkg/workloads/cortex/onnx_serve

1 file changed

+4
-2
lines changed

pkg/workloads/cortex/onnx_serve/api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def convert_to_onnx_input(sample, input_metadata_list):
149149
raise
150150
else:
151151
for input_metadata in input_metadata_list:
152-
if not util.is_dict(input_metadata):
152+
if not util.is_dict(sample):
153153
expected_keys = [metadata.name for metadata in input_metadata_list]
154154
raise UserException(
155155
"expected sample to be a dictionary with keys {}".format(
@@ -160,7 +160,9 @@ def convert_to_onnx_input(sample, input_metadata_list):
160160
if sample.get(input_metadata.name) is None:
161161
raise UserException('missing key "{}"'.format(input_metadata.name))
162162
try:
163-
input_dict[input_metadata.name] = transform_to_numpy(sample, input_metadata)
163+
input_dict[input_metadata.name] = transform_to_numpy(
164+
sample[input_metadata.name], input_metadata
165+
)
164166
except CortexException as e:
165167
e.wrap('key "{}"'.format(input_metadata.name))
166168
raise

0 commit comments

Comments
 (0)