Spaces:
Running
Running
File size: 3,099 Bytes
bb12f79 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | import gradio as gr
with gr.Blocks() as demo:
gr.Markdown("# Pending Input Components")
with gr.Row():
with gr.Column():
file = gr.File()
btn = gr.Button("Upload")
with gr.Column():
output_file = gr.File()
btn.click(
lambda s: (s),
file,
output_file,
)
with gr.Row():
with gr.Column():
img = gr.Image(type="filepath")
btn_2 = gr.Button("Upload")
with gr.Column():
output_file_2 = gr.File()
btn_2.click(
lambda s: (s),
img,
output_file_2,
)
with gr.Row():
with gr.Column():
audio = gr.Audio(type="filepath")
btn_3 = gr.Button("Upload")
with gr.Column():
output_file_3 = gr.File()
btn_3.click(
lambda s: (s),
audio,
output_file_3,
)
with gr.Row():
with gr.Column():
video = gr.Video()
btn_3 = gr.Button("Upload")
with gr.Column():
output_file_4 = gr.File()
btn_3.click(
lambda s: (s),
video,
output_file_4,
)
with gr.Row():
with gr.Column():
model3d = gr.Model3D()
btn_4 = gr.Button("Upload")
with gr.Column():
output_file_4 = gr.File()
btn_4.click(
lambda s: (s),
model3d,
output_file_4,
)
with gr.Row():
with gr.Column():
gallery = gr.Gallery()
btn_5 = gr.Button("Upload")
with gr.Column():
output_file_5 = gr.File(file_count="multiple")
btn_5.click(
lambda s: [x[0] for x in s],
gallery,
output_file_5,
)
# with gr.Row():
# with gr.Column():
# df = gr.Dataframe()
# btn_6 = gr.Button("Upload")
# with gr.Column():
# output_file_6 = gr.File()
# btn_6.click(
# lambda s: (s),
# df,
# output_file_6,
# )
with gr.Row():
with gr.Column():
imageslider = gr.ImageSlider(type="filepath")
btn_7 = gr.Button("Upload")
with gr.Column():
output_file_7 = gr.File()
btn_7.click(
lambda s: s[0],
imageslider,
output_file_7,
)
with gr.Row():
with gr.Column():
text = gr.MultimodalTextbox()
btn_8 = gr.Button("Upload")
with gr.Column():
output_file_8 = gr.File()
btn_8.click(
lambda s: s["files"],
text,
output_file_8,
)
if __name__ == "__main__":
demo.launch(
allowed_paths=["/private/var/folders/3w/6btg016509v7b2lz9h7vwqv00000gn/T"]
)
|