Skip to content

Commit 114c235

Browse files
author
jibxie
committed
Update
1 parent 52e125f commit 114c235

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/model.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,11 @@ async def generate(self, request):
392392
if isinstance(prompt, bytes):
393393
prompt = prompt.decode("utf-8")
394394

395-
multi_modal_data = pb_utils.get_input_tensor_by_name(
395+
multi_modal_data_input_tensor = pb_utils.get_input_tensor_by_name(
396396
request, "multi_modal_data"
397-
).as_numpy()[0]
398-
if isinstance(multi_modal_data, bytes):
399-
multi_modal_data = multi_modal_data.decode("utf-8")
400-
401-
if multi_modal_data is not None:
397+
)
398+
if multi_modal_data_input_tensor:
399+
multi_modal_data = multi_modal_data_input_tensor.as_numpy()[0].decode("utf-8")
402400
# Build TextPrompt format prompt for multi modal models
403401
multi_modal_data = json.loads(multi_modal_data)
404402
prompt = {

0 commit comments

Comments
 (0)