jschwab21 commited on
Commit
b86b5dd
·
verified ·
1 Parent(s): 5c42ea2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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
- 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()
 
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()