Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -131,15 +131,21 @@ def interface_function(video_file):
|
|
131 |
def test_upload(uploaded_file):
|
132 |
if uploaded_file is None:
|
133 |
return "No file uploaded."
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
with gr.Blocks() as demo:
|
145 |
with gr.Column():
|
|
|
131 |
def test_upload(uploaded_file):
|
132 |
if uploaded_file is None:
|
133 |
return "No file uploaded."
|
134 |
+
try:
|
135 |
+
# Save the uploaded file and process it
|
136 |
+
file_path = save_uploaded_file(uploaded_file)
|
137 |
+
if not file_path:
|
138 |
+
return "Failed to save file."
|
139 |
+
|
140 |
+
# Process the video using the path
|
141 |
+
result_path = process_video(file_path, description="Describe your clip here", is_url=False)
|
142 |
+
if not result_path:
|
143 |
+
return "Failed to process video or no scenes found."
|
144 |
+
|
145 |
+
return f"Video processed and saved to: {result_path}"
|
146 |
+
except Exception as e:
|
147 |
+
# Catch any exceptions that occur and return them for debugging
|
148 |
+
return f"An error occurred: {str(e)}"
|
149 |
|
150 |
with gr.Blocks() as demo:
|
151 |
with gr.Column():
|