kasim90 commited on
Commit
fe4ee33
Β·
verified Β·
1 Parent(s): 8b909bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -5,16 +5,18 @@ from datasets import load_dataset
5
  import gradio as gr
6
  import spaces
7
 
8
- ----------------------------
9
  import time
10
  import gradio as gr
11
 
12
  def slow_echo(message, history):
13
  for i in range(len(message)):
 
14
  time.sleep(0.05)
 
15
  yield "You typed: " + message[: i + 1]
16
 
17
- main = gr.ChatInterface(
18
  slow_echo,
19
  type="messages",
20
  flagging_mode="manual",
@@ -23,9 +25,9 @@ main = gr.ChatInterface(
23
  )
24
 
25
  if __name__ == "__main__":
26
- main.launch()
27
 
28
- --------------------
29
 
30
 
31
  @spaces.GPU
 
5
  import gradio as gr
6
  import spaces
7
 
8
+ #----------------------------
9
  import time
10
  import gradio as gr
11
 
12
  def slow_echo(message, history):
13
  for i in range(len(message)):
14
+ main()
15
  time.sleep(0.05)
16
+
17
  yield "You typed: " + message[: i + 1]
18
 
19
+ demo = gr.ChatInterface(
20
  slow_echo,
21
  type="messages",
22
  flagging_mode="manual",
 
25
  )
26
 
27
  if __name__ == "__main__":
28
+ demo.launch()
29
 
30
+ #--------------------
31
 
32
 
33
  @spaces.GPU