Skip to content

Commit e61cdcd

Browse files
authored
Disallow the use of post_predict for grpc protocol (#2015)
1 parent 31b8131 commit e61cdcd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/cortex/serve/cortex_internal/lib/api/validations.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,9 @@ def validate_predictor_with_grpc(impl, api_spec):
171171
f'invalid signature for method "predict"',
172172
f'{util.string_plural_with_s("argument", len(disallowed_params))} {util.and_list_with_quotes(disallowed_params)} cannot be used when the grpc protocol is enabled',
173173
)
174+
175+
if getattr(impl, "post_predict", None):
176+
raise UserException(
177+
f"class {target_class_name}",
178+
f"post_predict method is not supported when the grpc protocol is enabled",
179+
)

0 commit comments

Comments
 (0)