We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9dd4ca commit 134538aCopy full SHA for 134538a
llmlib/llmlib/huggingface_inference.py
@@ -59,8 +59,10 @@ def convert_message_to_openai_format(
59
60
61
@ttl_cache(ttl=10 * 60) # 10 minutes
62
-def video_to_imgs(video_path: Path, max_n_frames: int) -> list[PIL.Image.Image]:
+def video_to_imgs(video_path: Path | str, max_n_frames: int) -> list[PIL.Image.Image]:
63
"""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)
66
assert isinstance(video_path, Path), video_path
67
assert video_path.exists(), video_path
68
cap = cv2.VideoCapture(str(video_path))
0 commit comments