File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff 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 = {
You can’t perform that action at this time.
0 commit comments