Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -146,12 +146,18 @@ def interface_function(video_file):
|
|
146 |
def test_upload(video_file):
|
147 |
if video_file is not None:
|
148 |
return f"Received file with {len(video_file)} bytes"
|
149 |
-
|
|
|
150 |
|
151 |
with gr.Blocks() as demo:
|
152 |
with gr.Column():
|
153 |
video_file = gr.UploadButton("Upload Video File", type="binary", file_types=["video"])
|
154 |
output = gr.Textbox()
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
demo.launch()
|
|
|
146 |
def test_upload(video_file):
|
147 |
if video_file is not None:
|
148 |
return f"Received file with {len(video_file)} bytes"
|
149 |
+
else:
|
150 |
+
return "No file uploaded."
|
151 |
|
152 |
with gr.Blocks() as demo:
|
153 |
with gr.Column():
|
154 |
video_file = gr.UploadButton("Upload Video File", type="binary", file_types=["video"])
|
155 |
output = gr.Textbox()
|
156 |
+
submit_button = gr.Button("Process Video")
|
157 |
+
submit_button.click(
|
158 |
+
fn=test_upload,
|
159 |
+
inputs=[video_file],
|
160 |
+
outputs=[output]
|
161 |
+
)
|
162 |
|
163 |
demo.launch()
|