radames's picture
first
7b6bb0b
raw
history blame
No virus
733 Bytes
import gradio as gr
from gradio_rerun import Rerun
def predict(file_path: str | list[str]):
return file_path
with gr.Blocks(css=".gradio-container { max-width: unset!important; }") as demo:
with gr.Row():
with gr.Column():
file_path = gr.File(file_count="multiple", type="filepath")
with gr.Column():
pass
btn = gr.Button("Run", scale=0)
with gr.Row():
rerun_viewer = Rerun(height=900)
inputs = [file_path]
outputs = [rerun_viewer]
gr.on(
[btn.click, file_path.upload],
fn=predict,
inputs=inputs,
outputs=outputs,
)
gr.on([btn.click, file_path.upload], fn=predict, inputs=inputs, outputs=outputs)
demo.launch()