File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -194,12 +194,13 @@ def from_dict(cls, d: dict):
194194 isinstance (d .get ("multimodal_inputs" ), dict )
195195 and isinstance (d ["multimodal_inputs" ].get ("mm_positions" ), list )
196196 and len (d ["multimodal_inputs" ]["mm_positions" ]) > 0
197- and not isinstance (d ["multimodal_inputs" ]["mm_positions" ][0 ], ImagePosition )
198197 ):
199198 # if mm_positions is not of type ImagePosition, convert to ImagePosition
200199 try :
201200 for i , mm_pos in enumerate (d ["multimodal_inputs" ]["mm_positions" ]):
202- d ["multimodal_inputs" ]["mm_positions" ][i ] = ImagePosition (** mm_pos )
201+ d ["multimodal_inputs" ]["mm_positions" ][i ] = (
202+ ImagePosition (** mm_pos ) if not isinstance (mm_pos , ImagePosition ) else mm_pos
203+ )
203204 except Exception as e :
204205 data_processor_logger .error (
205206 f"Convert mm_positions to ImagePosition error: { e } , { str (traceback .format_exc ())} "
You can’t perform that action at this time.
0 commit comments