From 1637365ddc84ae7ece81d0852181f410253015b2 Mon Sep 17 00:00:00 2001 From: KairuiHu Date: Thu, 28 Nov 2024 10:58:10 +0800 Subject: [PATCH] fix python 3.10 issue in pyav load video --- lmms_eval/models/model_utils/load_video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmms_eval/models/model_utils/load_video.py b/lmms_eval/models/model_utils/load_video.py index 777e41f3..98aaece6 100644 --- a/lmms_eval/models/model_utils/load_video.py +++ b/lmms_eval/models/model_utils/load_video.py @@ -129,7 +129,7 @@ def read_video_pyav_pil(video_path: str, *, num_frm: int = 8, fps: float = None, # return [Image.fromarray(frame) for frame in frames] -def read_video_pyav_base64(video_path: str, *, num_frm: int = 8, fps: Optional[float] = None, format="rgb24", img_format="PNG", max_image_size: Optional[Tuple[int, int] | int] = None, resize_strategy: str = "resize"): +def read_video_pyav_base64(video_path: str, *, num_frm: int = 8, fps: Optional[float] = None, format="rgb24", img_format="PNG", max_image_size: Optional[Union[Tuple[int, int], int]] = None, resize_strategy: str = "resize"): frames = read_video_pyav(video_path, num_frm=num_frm, fps=fps, format=format) base64_frames = [] for frame in frames: