Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -124,9 +124,8 @@ def inference(video, step_number):
|
|
124 |
if not video:
|
125 |
return "Please upload a video first."
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
video_data = video.read()
|
130 |
|
131 |
# Get possible reasons for the selected step
|
132 |
possible_reasons = DELAY_REASONS[step_number]
|
@@ -139,9 +138,6 @@ def inference(video, step_number):
|
|
139 |
response = predict(prompt, video_data, temperature, model, tokenizer)
|
140 |
|
141 |
return response
|
142 |
-
|
143 |
-
except Exception as e:
|
144 |
-
return f"An error occurred: {str(e)}"
|
145 |
|
146 |
# Gradio Interface
|
147 |
def create_interface():
|
|
|
124 |
if not video:
|
125 |
return "Please upload a video first."
|
126 |
|
127 |
+
with open(video_path, "rb") as f:
|
128 |
+
video_data = f.read()
|
|
|
129 |
|
130 |
# Get possible reasons for the selected step
|
131 |
possible_reasons = DELAY_REASONS[step_number]
|
|
|
138 |
response = predict(prompt, video_data, temperature, model, tokenizer)
|
139 |
|
140 |
return response
|
|
|
|
|
|
|
141 |
|
142 |
# Gradio Interface
|
143 |
def create_interface():
|