Commit
·
881b8cd
1
Parent(s):
1e9b2e2
Upload app.py with huggingface_hub
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
with gr.Blocks() as interface:
|
4 |
+
number = gr.Number()
|
5 |
+
text = gr.Textbox()
|
6 |
+
file1 = gr.File()
|
7 |
+
file2 = gr.File()
|
8 |
+
file3 = gr.File(file_count="multiple")
|
9 |
+
file1.upload(lambda a, b, x:x.name, [number, text, file1], file2, api_name="file_upload")
|
10 |
+
upload_button = gr.UploadButton("Click to Upload a File", file_types=["image", "video"], file_count="single")
|
11 |
+
upload_button.upload(lambda x: x.name, upload_button, file2, api_name="upload_btn")
|
12 |
+
file3.upload(lambda n, fs, t: [f.name for f in fs], [number, file3, text], file2, api_name="upload_multiple")
|
13 |
+
|
14 |
+
|
15 |
+
interface.launch()
|