Skip to content

Commit d72299d

Browse files
authored
Make the cv2 dependency optional (#27780)
Signed-off-by: Jacob <cmpute@qq.com>
1 parent 80679f1 commit d72299d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vllm/benchmarks/datasets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from tempfile import NamedTemporaryFile
3131
from typing import Any, cast
3232

33-
import cv2
3433
import numpy as np
3534
from PIL import Image
3635
from transformers import PreTrainedTokenizerBase
@@ -850,6 +849,8 @@ def generate_synthetic_video(
850849
Creates a video with random pixel values, encodes it to MP4 format,
851850
and returns the content as bytes.
852851
"""
852+
import cv2
853+
853854
random_pixels = self._rng.integers(
854855
0,
855856
256,

0 commit comments

Comments
 (0)