Skip to content

Commit

Permalink
Fix the optional stream
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayv25 committed Oct 10, 2023
1 parent 40f38ff commit 3306dc8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3306dc8

Please sign in to comment.