John Liao
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
-
import time
|
| 2 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
for i in range(len(message)):
|
| 6 |
-
time.sleep(0.3)
|
| 7 |
-
yield "You typed: " + message[: i+1]
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
| 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()
|