Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def dummy(file_objs):
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
with gr.Blocks() as demo:
|
| 8 |
with gr.Row():
|
| 9 |
-
fl = gr.File(file_count='single')
|
| 10 |
tb = gr.TextArea()
|
| 11 |
gr.Button().click(dummy, fl, tb)
|
| 12 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def dummy(file_objs):
|
| 4 |
+
print(file_objs)
|
| 5 |
+
if isinstance(file_objs, list):
|
| 6 |
+
files = [f for f in file_objs]
|
| 7 |
+
return files
|
| 8 |
+
return file_objs
|
| 9 |
|
| 10 |
with gr.Blocks() as demo:
|
| 11 |
with gr.Row():
|
| 12 |
+
fl = gr.File(file_count='single', label='Testing for Single File Count')
|
| 13 |
tb = gr.TextArea()
|
| 14 |
gr.Button().click(dummy, fl, tb)
|
| 15 |
|