Skip to content

Commit 134538a

Browse files
committed
Accept str as VideoPath
1 parent d9dd4ca commit 134538a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llmlib/llmlib/huggingface_inference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ def convert_message_to_openai_format(
5959

6060

6161
@ttl_cache(ttl=10 * 60) # 10 minutes
62-
def video_to_imgs(video_path: Path, max_n_frames: int) -> list[PIL.Image.Image]:
62+
def video_to_imgs(video_path: Path | str, max_n_frames: int) -> list[PIL.Image.Image]:
6363
"""From https://github.com/agustoslu/simple-inference-benchmark/blob/5cec55787d34af65f0d11efc429c3d4de92f051a/utils.py#L79"""
64+
if isinstance(video_path, str):
65+
video_path = Path(video_path)
6466
assert isinstance(video_path, Path), video_path
6567
assert video_path.exists(), video_path
6668
cap = cv2.VideoCapture(str(video_path))

0 commit comments

Comments
 (0)