ganeshkamath89 commited on
Commit
4636668
·
verified ·
1 Parent(s): d3cbac3

Adding a streaming function to chat

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
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()