ankandrew commited on
Commit
f20b359
·
verified ·
1 Parent(s): 2c78a32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- gr.Error("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
- gr.Error("Could not process video.")
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
- gr.Error("Please input a query and optionally image(s).")
126
  return
127
  if text == "" and images:
128
- gr.Error("Please input a text query along with the image(s).")
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 = [