Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -143,15 +143,15 @@ def interface_function(video_file):
|
|
143 |
return f"File saved at {file_path}"
|
144 |
return "No file uploaded."
|
145 |
|
|
|
|
|
|
|
|
|
|
|
146 |
with gr.Blocks() as demo:
|
147 |
with gr.Column():
|
148 |
-
video_file = gr.UploadButton(
|
149 |
-
|
150 |
-
|
151 |
-
submit_button.click(
|
152 |
-
fn=interface_function,
|
153 |
-
inputs=[video_file],
|
154 |
-
outputs=[output_text]
|
155 |
-
)
|
156 |
|
157 |
demo.launch()
|
|
|
143 |
return f"File saved at {file_path}"
|
144 |
return "No file uploaded."
|
145 |
|
146 |
+
def test_upload(video_file):
|
147 |
+
if video_file is not None:
|
148 |
+
return f"Received file with {len(video_file)} bytes"
|
149 |
+
return "No file uploaded."
|
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 |
+
video_file.change(test_upload, inputs=[video_file], outputs=[output])
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
demo.launch()
|