Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,13 +72,13 @@ def model_inference(input_dict, history):
|
|
| 72 |
# Remove the tag from the query.
|
| 73 |
text = text[len("@video-infer"):].strip()
|
| 74 |
if not files:
|
| 75 |
-
|
| 76 |
return
|
| 77 |
# Assume the first file is a video.
|
| 78 |
video_path = files[0]
|
| 79 |
frames = downsample_video(video_path)
|
| 80 |
if not frames:
|
| 81 |
-
|
| 82 |
return
|
| 83 |
# Build messages: start with the text prompt.
|
| 84 |
messages = [
|
|
@@ -122,10 +122,10 @@ def model_inference(input_dict, history):
|
|
| 122 |
images = []
|
| 123 |
|
| 124 |
if text == "" and not images:
|
| 125 |
-
|
| 126 |
return
|
| 127 |
if text == "" and images:
|
| 128 |
-
|
| 129 |
return
|
| 130 |
|
| 131 |
messages = [
|
|
|
|
| 72 |
# Remove the tag from the query.
|
| 73 |
text = text[len("@video-infer"):].strip()
|
| 74 |
if not files:
|
| 75 |
+
yield "⚠️ Please upload a video file along with your `@video-infer` query."
|
| 76 |
return
|
| 77 |
# Assume the first file is a video.
|
| 78 |
video_path = files[0]
|
| 79 |
frames = downsample_video(video_path)
|
| 80 |
if not frames:
|
| 81 |
+
yield "⚠️ Could not process the video (no frames were read)."
|
| 82 |
return
|
| 83 |
# Build messages: start with the text prompt.
|
| 84 |
messages = [
|
|
|
|
| 122 |
images = []
|
| 123 |
|
| 124 |
if text == "" and not images:
|
| 125 |
+
yield "⚠️ Please enter a question and/or upload image(s)."
|
| 126 |
return
|
| 127 |
if text == "" and images:
|
| 128 |
+
yield "⚠️ Please enter a text prompt along with the image(s)."
|
| 129 |
return
|
| 130 |
|
| 131 |
messages = [
|