Video-LLaVa: handle any number of frames (#31221)

video-llava can handle more frames
This commit is contained in:
Raushan Turganbay
2024-06-04 14:20:03 +05:00
committed by GitHub
parent 36ade4a32b
commit d64e4da713
2 changed files with 8 additions and 6 deletions

View File

@@ -487,6 +487,9 @@ class VideoLlavaForConditionalGenerationIntegrationTest(unittest.TestCase):
repo_id="raushan-testing-hf/videos-test", filename="video_demo.npy", repo_type="dataset"
)
video_file = np.load(video_file)
# let's expand it for 16 frames, to check model can handle any number of frames
video_file = video_file.repeat(2, 0)
inputs = self.processor(prompt, videos=video_file, return_tensors="pt").to(torch_device, torch.float16)
# Make sure that `generate` works