Spaces:
Runtime error
Runtime error
Update run.py
Browse files
run.py
CHANGED
@@ -49,17 +49,14 @@ def fast_caption(sys_prompt, usr_prompt, temp, top_p, max_tokens, model, key, en
|
|
49 |
video = df['video'][0]
|
50 |
|
51 |
md5 = hashlib.md5(video).hexdigest()
|
52 |
-
|
53 |
-
temp_video_file.write(video)
|
54 |
-
video_path = temp_video_file.name
|
55 |
-
print(video_path)
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
|
64 |
return "\n\n\n".join(all_captions), f"Processed {len(video_paths)} videos.", None
|
65 |
|
|
|
49 |
video = df['video'][0]
|
50 |
|
51 |
md5 = hashlib.md5(video).hexdigest()
|
52 |
+
print(md5)
|
|
|
|
|
|
|
53 |
|
54 |
+
processor = VideoProcessor(frame_format=frame_format, frame_limit=frame_limit)
|
55 |
+
frames = processor._decode(video_path)
|
56 |
+
base64_list = processor.to_base64_list(frames)
|
57 |
+
api = AzureAPI(key=key, endpoint=endpoint, model=model, temp=temp, top_p=top_p, max_tokens=max_tokens)
|
58 |
+
caption = api.get_caption(sys_prompt, usr_prompt, base64_list)
|
59 |
+
all_captions.append(caption)
|
60 |
|
61 |
return "\n\n\n".join(all_captions), f"Processed {len(video_paths)} videos.", None
|
62 |
|