Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,18 +167,20 @@ def process_video(video_file, question, password, progress=gr.Progress()):
|
|
| 167 |
else:
|
| 168 |
raise gr.Error("Video clip file not found.")
|
| 169 |
|
| 170 |
-
# If it returns a dict
|
| 171 |
-
elif isinstance(video_clip_info, dict)
|
| 172 |
-
|
| 173 |
-
if
|
| 174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
else:
|
| 176 |
-
raise gr.Error("
|
| 177 |
else:
|
| 178 |
-
# Unexpected format for video_clip_info
|
| 179 |
raise gr.Error("Unexpected video clip info format.")
|
| 180 |
else:
|
| 181 |
-
# Unexpected result format
|
| 182 |
raise gr.Error("Unexpected response format from private service.")
|
| 183 |
|
| 184 |
def create_interface():
|
|
|
|
| 167 |
else:
|
| 168 |
raise gr.Error("Video clip file not found.")
|
| 169 |
|
| 170 |
+
# If it returns a dict, handle accordingly
|
| 171 |
+
elif isinstance(video_clip_info, dict):
|
| 172 |
+
# Check if "video" key is present
|
| 173 |
+
if "video" in video_clip_info:
|
| 174 |
+
clip_path = video_clip_info["video"]
|
| 175 |
+
if os.path.exists(clip_path):
|
| 176 |
+
return analysis_text, clip_path
|
| 177 |
+
else:
|
| 178 |
+
raise gr.Error("Video clip file not found.")
|
| 179 |
else:
|
| 180 |
+
raise gr.Error("Unexpected dictionary format for video clip info.")
|
| 181 |
else:
|
|
|
|
| 182 |
raise gr.Error("Unexpected video clip info format.")
|
| 183 |
else:
|
|
|
|
| 184 |
raise gr.Error("Unexpected response format from private service.")
|
| 185 |
|
| 186 |
def create_interface():
|