22
22
"""
23
23
import os
24
24
25
- import pytest
26
25
from vllm import SamplingParams
27
26
from vllm .assets .audio import AudioAsset
28
27
from vllm .assets .image import ImageAsset
29
28
30
29
from tests .e2e .conftest import VllmRunner
31
30
31
+ os .environ ["VLLM_WORKER_MULTIPROC_METHOD" ] = "spawn"
32
32
os .environ ["PYTORCH_NPU_ALLOC_CONF" ] = "max_split_size_mb:256"
33
33
34
34
35
- @pytest .mark .skip (reason = "fix me" )
36
35
def test_multimodal_vl (prompt_template ):
37
36
image = ImageAsset ("cherry_blossom" ) \
38
37
.pil_image .convert ("RGB" )
@@ -52,9 +51,12 @@ def test_multimodal_vl(prompt_template):
52
51
"fps" : 1 ,
53
52
},
54
53
enforce_eager = True ) as vllm_model :
55
- vllm_model .generate_greedy (prompts = prompts ,
56
- images = images ,
57
- max_tokens = 64 )
54
+ outputs = vllm_model .generate_greedy (prompts = prompts ,
55
+ images = images ,
56
+ max_tokens = 64 )
57
+ assert len (outputs ) == len (prompts )
58
+ for _ , output_str in outputs :
59
+ assert output_str , "Generated output should not be empty."
58
60
59
61
60
62
def test_multimodal_audio ():
@@ -86,4 +88,7 @@ def test_multimodal_audio():
86
88
dtype = "bfloat16" ,
87
89
limit_mm_per_prompt = {"audio" : 2 },
88
90
gpu_memory_utilization = 0.9 ) as runner :
89
- runner .generate (inputs , sampling_params = sampling_params )
91
+ outputs = runner .generate (inputs , sampling_params = sampling_params )
92
+
93
+ assert outputs is not None , "Generated outputs should not be None."
94
+ assert len (outputs ) > 0 , "Generated outputs should not be empty."
0 commit comments