Spaces:
Sleeping
Sleeping
韩宇
commited on
Commit
·
1621c54
1
Parent(s):
0b0cf33
init req
Browse files- agent/video_preprocessor/webpage_vp.py +4 -4
- webpage.py +7 -2
agent/video_preprocessor/webpage_vp.py
CHANGED
|
@@ -241,10 +241,10 @@ class WebpageVideoPreprocessor(BaseLLMBackend, BaseWorker):
|
|
| 241 |
self.callback.error(f"Failed to process scene {index}: {e}")
|
| 242 |
scene.summary = None
|
| 243 |
|
| 244 |
-
if self.use_cache and not cache_path.exists():
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
return {
|
| 249 |
"video_md5": video_md5,
|
| 250 |
"video_path": video_path,
|
|
|
|
| 241 |
self.callback.error(f"Failed to process scene {index}: {e}")
|
| 242 |
scene.summary = None
|
| 243 |
|
| 244 |
+
# if self.use_cache and not cache_path.exists():
|
| 245 |
+
# cache_path.parent.mkdir(parents=True, exist_ok=True)
|
| 246 |
+
# with open(cache_path, "wb") as f:
|
| 247 |
+
# pickle.dump(video.scenes, f)
|
| 248 |
return {
|
| 249 |
"video_md5": video_md5,
|
| 250 |
"video_path": video_path,
|
webpage.py
CHANGED
|
@@ -140,8 +140,9 @@ class WebpageClient:
|
|
| 140 |
logging.error(f"Error starting workflow: {e}")
|
| 141 |
raise e
|
| 142 |
|
| 143 |
-
workflow_thread = threading.Thread(target=run_workflow, args=(workflow_input,)
|
| 144 |
-
workflow_thread.start()
|
|
|
|
| 145 |
|
| 146 |
processor_workflow_instance_id = self.processor_instance_id
|
| 147 |
while True:
|
|
@@ -267,6 +268,10 @@ class WebpageClient:
|
|
| 267 |
history.append({"role": "assistant", "content": 'Please select a video'})
|
| 268 |
return history, gr.Textbox(value=None, interactive=False)
|
| 269 |
else:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
if state.get('current_video') is None:
|
| 271 |
history.append({"role": "user", "content": message})
|
| 272 |
history.append({"role": "assistant", "content": 'Please select a video'})
|
|
|
|
| 140 |
logging.error(f"Error starting workflow: {e}")
|
| 141 |
raise e
|
| 142 |
|
| 143 |
+
# workflow_thread = threading.Thread(target=run_workflow, args=(workflow_input,))
|
| 144 |
+
# workflow_thread.start()
|
| 145 |
+
run_workflow(workflow_input)
|
| 146 |
|
| 147 |
processor_workflow_instance_id = self.processor_instance_id
|
| 148 |
while True:
|
|
|
|
| 268 |
history.append({"role": "assistant", "content": 'Please select a video'})
|
| 269 |
return history, gr.Textbox(value=None, interactive=False)
|
| 270 |
else:
|
| 271 |
+
if not state.value:
|
| 272 |
+
history.append({"role": "user", "content": message})
|
| 273 |
+
history.append({"role": "assistant", "content": 'Please reselect the video'})
|
| 274 |
+
return history, gr.Textbox(value=None, interactive=False)
|
| 275 |
if state.get('current_video') is None:
|
| 276 |
history.append({"role": "user", "content": message})
|
| 277 |
history.append({"role": "assistant", "content": 'Please select a video'})
|