John Liao commited on
Commit
fcd94a0
·
verified ·
1 Parent(s): f118281

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,9 +1,10 @@
1
- import time
2
  import gradio as gr
 
 
 
 
 
3
 
4
- def slow_echo(message, history):
5
- for i in range(len(message)):
6
- time.sleep(0.3)
7
- yield "You typed: " + message[: i+1]
8
 
9
- gr.ChatInterface(slow_echo).launch()
 
 
1
  import gradio as gr
2
+ import time
3
+
4
+ def count_files(message, history):
5
+ num_files = len(message["files"])
6
+ return f"You uploaded {num_files} files"
7
 
8
+ demo = gr.ChatInterface(fn=count_files, examples=[{"text": "Hello", "files": []}], title="Echo Bot", multimodal=True)
 
 
 
9
 
10
+ demo.launch()