freddyaboulton HF staff commited on
Commit
5697c79
1 Parent(s): 0da0703

Use gr.File instead of gr.Files for a better experience on mobile phones

Browse files

Hello! There is a bug in gradio where the `file_types` parameter is not working with `gr.Files`. See (https://github.com/gradio-app/gradio/issues/7137). While I fix it in gradio, this PR should fix it in your demo. `gr.File(file_count="multiple")` is the same as `gr.Files`.

Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -198,9 +198,10 @@ with gr.Blocks(css=css) as demo:
198
  # )
199
  with gr.Row():
200
  with gr.Column():
201
- files = gr.Files(
202
  label="Drag (Select) 1 or more photos of your face",
203
- file_types=["image"]
 
204
  )
205
  uploaded_files = gr.Gallery(label="Your images", visible=False, columns=5, rows=1, height=200)
206
  with gr.Column(visible=False) as clear_button:
 
198
  # )
199
  with gr.Row():
200
  with gr.Column():
201
+ files = gr.File(
202
  label="Drag (Select) 1 or more photos of your face",
203
+ file_types=["image"],
204
+ file_count="multiple"
205
  )
206
  uploaded_files = gr.Gallery(label="Your images", visible=False, columns=5, rows=1, height=200)
207
  with gr.Column(visible=False) as clear_button: