Tonic commited on
Commit
4fa7fae
•
2 Parent(s): b841cef 0e49d67

Merge branch 'main' of https://huggingface.co/spaces/Tonic/Llava-Video

Browse files
Files changed (1) hide show
  1. app.py +1 -13
app.py CHANGED
@@ -90,19 +90,7 @@ def process_video(video_path, question):
90
  def gradio_interface(video_file, question):
91
  if video_file is None:
92
  return "Please upload a video file."
93
-
94
- # Create a temporary directory to store the video
95
- with tempfile.TemporaryDirectory() as temp_dir:
96
- temp_video_path = os.path.join(temp_dir, "temp_video.mp4")
97
-
98
- # Copy the video file to the temporary directory
99
- shutil.copy2(video_file, temp_video_path)
100
-
101
- try:
102
- response = process_video(temp_video_path, question)
103
- except Exception as e:
104
- return f"An error occurred: {str(e)}"
105
-
106
  return response
107
 
108
  with gr.Blocks() as demo:
 
90
  def gradio_interface(video_file, question):
91
  if video_file is None:
92
  return "Please upload a video file."
93
+ response = process_video(video_file, question)
 
 
 
 
 
 
 
 
 
 
 
 
94
  return response
95
 
96
  with gr.Blocks() as demo: