2626import  vllm   # noqa: F401 
2727
2828from  tests .conftest  import  VllmRunner 
29+ from  vllm .assets .image  import  ImageAsset 
2930
3031os .environ ["PYTORCH_NPU_ALLOC_CONF" ] =  "max_split_size_mb:256" 
3132
3233
3334@pytest .mark .parametrize ("model, distributed_executor_backend" , [ 
3435    ("Qwen/QwQ-32B" , "mp" ), 
36+     ("deepseek-ai/DeepSeek-V2-Lite" , "mp" ), 
3537]) 
3638def  test_models_distributed (model : str ,
3739                            distributed_executor_backend : str ) ->  None :
@@ -51,6 +53,34 @@ def test_models_distributed(model: str,
5153        vllm_model .generate_greedy (example_prompts , max_tokens )
5254
5355
56+ @pytest .mark .parametrize ("model" , ["Qwen/Qwen2.5-VL-32B-Instruct" ]) 
57+ @pytest .mark .skipif (os .getenv ("VLLM_USE_V1" ) ==  "1" , 
58+                     reason = "qwen2.5_vl is not supported on v1" ) 
59+ def  test_multimodal (model : str , prompt_template , vllm_runner ):
60+     image  =  ImageAsset ("cherry_blossom" ) \
61+         .pil_image .convert ("RGB" )
62+     img_questions  =  [
63+         "What is the content of this image?" ,
64+         "Describe the content of this image in detail." ,
65+         "What's in the image?" ,
66+         "Where is this image taken?" ,
67+     ]
68+     images  =  [image ] *  len (img_questions )
69+     prompts  =  prompt_template (img_questions )
70+     with  vllm_runner (model ,
71+                      max_model_len = 4096 ,
72+                      tensor_parallel_size = 4 ,
73+                      distributed_executor_backend = "mp" ,
74+                      mm_processor_kwargs = {
75+                          "min_pixels" : 28  *  28 ,
76+                          "max_pixels" : 1280  *  28  *  28 ,
77+                          "fps" : 1 ,
78+                      }) as  vllm_model :
79+         vllm_model .generate_greedy (prompts = prompts ,
80+                                    images = images ,
81+                                    max_tokens = 64 )
82+ 
83+ 
5484if  __name__  ==  "__main__" :
5585    import  pytest 
5686    pytest .main ([__file__ ])
0 commit comments