mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-24 10:54:04 +08:00
12 lines
381 B
Python
12 lines
381 B
Python
import gradio as gr
|
|
|
|
def upload_file(files):
|
|
file_paths = [file.name for file in files]
|
|
return file_paths
|
|
|
|
with gr.Blocks() as demo:
|
|
file_output = gr.File()
|
|
upload_button = gr.UploadButton("Click to Upload an Image or Video File", file_types=["image", "video"], file_count="multiple")
|
|
upload_button.upload(upload_file, upload_button, file_output)
|
|
|
|
demo.launch() |