@@ -250,7 +250,7 @@ def prompt(self) -> Optional[str]:
250
250
if inputs ["type" ] == "token" or inputs ["type" ] == "multimodal" :
251
251
return inputs .get ("prompt" )
252
252
253
- assert_never (inputs )
253
+ assert_never (inputs ) # type: ignore[arg-type]
254
254
255
255
@cached_property
256
256
def prompt_token_ids (self ) -> List [int ]:
@@ -259,7 +259,7 @@ def prompt_token_ids(self) -> List[int]:
259
259
if inputs ["type" ] == "token" or inputs ["type" ] == "multimodal" :
260
260
return inputs .get ("prompt_token_ids" , [])
261
261
262
- assert_never (inputs )
262
+ assert_never (inputs ) # type: ignore[arg-type]
263
263
264
264
@cached_property
265
265
def token_type_ids (self ) -> List [int ]:
@@ -268,7 +268,7 @@ def token_type_ids(self) -> List[int]:
268
268
if inputs ["type" ] == "token" or inputs ["type" ] == "multimodal" :
269
269
return inputs .get ("token_type_ids" , [])
270
270
271
- assert_never (inputs )
271
+ assert_never (inputs ) # type: ignore[arg-type]
272
272
273
273
@cached_property
274
274
def prompt_embeds (self ) -> Optional [torch .Tensor ]:
@@ -277,7 +277,7 @@ def prompt_embeds(self) -> Optional[torch.Tensor]:
277
277
if inputs ["type" ] == "token" or inputs ["type" ] == "multimodal" :
278
278
return None
279
279
280
- assert_never (inputs )
280
+ assert_never (inputs ) # type: ignore[arg-type]
281
281
282
282
@cached_property
283
283
def multi_modal_data (self ) -> "MultiModalDataDict" :
@@ -289,7 +289,7 @@ def multi_modal_data(self) -> "MultiModalDataDict":
289
289
if inputs ["type" ] == "multimodal" :
290
290
return inputs .get ("mm_kwargs" , {})
291
291
292
- assert_never (inputs )
292
+ assert_never (inputs ) # type: ignore[arg-type]
293
293
294
294
@cached_property
295
295
def multi_modal_inputs (self ) -> Union [Dict , "MultiModalKwargs" ]:
@@ -301,7 +301,7 @@ def multi_modal_inputs(self) -> Union[Dict, "MultiModalKwargs"]:
301
301
if inputs ["type" ] == "multimodal" :
302
302
return inputs .get ("mm_kwargs" , {})
303
303
304
- assert_never (inputs )
304
+ assert_never (inputs ) # type: ignore[arg-type]
305
305
306
306
@cached_property
307
307
def multi_modal_hashes (self ) -> List [str ]:
@@ -311,9 +311,10 @@ def multi_modal_hashes(self) -> List[str]:
311
311
return inputs .get ("multi_modal_hashes" , [])
312
312
313
313
if inputs ["type" ] == "multimodal" :
314
- return inputs .get ("mm_hashes" , [])
314
+ # only the case when we use MultiModalInputsV2
315
+ return inputs .get ("mm_hashes" , []) # type: ignore[return-value]
315
316
316
- assert_never (inputs )
317
+ assert_never (inputs ) # type: ignore[arg-type]
317
318
318
319
@cached_property
319
320
def multi_modal_placeholders (self ) -> "MultiModalPlaceholderDict" :
@@ -325,7 +326,7 @@ def multi_modal_placeholders(self) -> "MultiModalPlaceholderDict":
325
326
if inputs ["type" ] == "multimodal" :
326
327
return inputs .get ("mm_placeholders" , {})
327
328
328
- assert_never (inputs )
329
+ assert_never (inputs ) # type: ignore[arg-type]
329
330
330
331
@cached_property
331
332
def mm_processor_kwargs (self ) -> Dict [str , Any ]:
@@ -337,7 +338,7 @@ def mm_processor_kwargs(self) -> Dict[str, Any]:
337
338
if inputs ["type" ] == "multimodal" :
338
339
return {}
339
340
340
- assert_never (inputs )
341
+ assert_never (inputs ) # type: ignore[arg-type]
341
342
342
343
343
344
ProcessorInputs = Union [DecoderOnlyInputs , EncoderDecoderInputs ]
0 commit comments