From 3306dc8a007a4fcb787ce93100431426736d20c8 Mon Sep 17 00:00:00 2001 From: tanmayv25 Date: Mon, 9 Oct 2023 21:28:14 -0700 Subject: [PATCH] Fix the optional stream --- src/model.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/model.py b/src/model.py index 7cbc2888..9888e2f1 100644 --- a/src/model.py +++ b/src/model.py @@ -179,7 +179,11 @@ async def generate(self, request): ).as_numpy()[0] if isinstance(prompt, bytes): prompt = prompt.decode("utf-8") - stream = pb_utils.get_input_tensor_by_name(request, "stream").as_numpy()[0] + stream = pb_utils.get_input_tensor_by_name(request, "stream") + if stream: + stream = stream.as_numpy()[0] + else: + stream = False # Request parameters are not yet supported via # BLS. Provide an optional mechanism to receive serialized