Update app.py
Browse files
app.py
CHANGED
|
@@ -2,15 +2,15 @@ import os
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
#debug use
|
| 5 |
-
def foo(
|
| 6 |
ret = []
|
| 7 |
-
for filename in os.listdir(
|
| 8 |
ret.append(filename)
|
| 9 |
return ret
|
| 10 |
|
| 11 |
# debug use
|
| 12 |
with gr.Blocks() as foo:
|
| 13 |
-
filein = gr.
|
| 14 |
show_out = gr.Textbox()
|
| 15 |
show = gr.Button(value="Show")
|
| 16 |
show.click(fn=foo, inputs=filein, outputs=show_out, queue=False)
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
#debug use
|
| 5 |
+
def foo(something):
|
| 6 |
ret = []
|
| 7 |
+
for filename in os.listdir(something.name):
|
| 8 |
ret.append(filename)
|
| 9 |
return ret
|
| 10 |
|
| 11 |
# debug use
|
| 12 |
with gr.Blocks() as foo:
|
| 13 |
+
filein = gr.File(file_count="directory")
|
| 14 |
show_out = gr.Textbox()
|
| 15 |
show = gr.Button(value="Show")
|
| 16 |
show.click(fn=foo, inputs=filein, outputs=show_out, queue=False)
|