Skip to content

Commit 28dc989

Browse files
committed
Use 'predict' signature def key if available
1 parent ee99345 commit 28dc989

File tree

1 file changed

+8
-3
lines changed
  • pkg/workloads/cortex/tf_api

1 file changed

+8
-3
lines changed

pkg/workloads/cortex/tf_api/api.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,19 @@ def extract_signature(signature_def, signature_key):
263263
if signature_key is None:
264264
if len(available_keys) == 1:
265265
logger.info(
266-
"signature_key was not configured by user, using signature key '{}' found in signature def map".format(
266+
"tf_signature_key was not configured by user, using signature key '{}' (found in the signature def map)".format(
267267
available_keys[0]
268268
)
269269
)
270270
signature_key = available_keys[0]
271+
elif "predict" in signature_def:
272+
logger.info(
273+
"tf_signature_key was not configured by user, using signature key 'predict' (found in the signature def map)"
274+
)
275+
signature_key = "predict"
271276
else:
272277
raise UserException(
273-
"signature_key was not configured by user, please specify one the following keys '{}' found in signature def map".format(
278+
"tf_signature_key was not configured by user, please specify one the following keys '{}' (found in the signature def map)".format(
274279
"', '".join(available_keys)
275280
)
276281
)
@@ -281,7 +286,7 @@ def extract_signature(signature_def, signature_key):
281286
possibilities_str = "keys: '{}'".format("', '".join(available_keys))
282287

283288
raise UserException(
284-
"signature_key '{}' was not found in signature def map, but found the following {}".format(
289+
"tf_signature_key '{}' was not found in signature def map, but found the following {}".format(
285290
signature_key, possibilities_str
286291
)
287292
)

0 commit comments

Comments
 (0)