Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,13 @@
|
|
1 |
### ROUND 1 ###
|
2 |
-
|
3 |
-
|
4 |
-
# def echo(message, history):
|
5 |
-
# return message
|
6 |
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
|
|
|
11 |
|
12 |
-
|
13 |
# import random
|
14 |
# import gradio as gr
|
15 |
|
@@ -40,19 +38,19 @@
|
|
40 |
# demo.launch()
|
41 |
|
42 |
### ROUND 4 ###
|
43 |
-
import time
|
44 |
-
import gradio as gr
|
45 |
|
46 |
-
def slow_echo(message, history):
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
|
51 |
-
demo = gr.ChatInterface(
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
)
|
56 |
|
57 |
-
if __name__ == "__main__":
|
58 |
-
|
|
|
1 |
### ROUND 1 ###
|
2 |
+
import gradio as gr
|
|
|
|
|
|
|
3 |
|
4 |
+
def echo(message, history):
|
5 |
+
return message
|
6 |
|
7 |
+
demo = gr.ChatInterface(fn=echo, type="messages", examples=["hello", "hola", "merhaba"], title="Echo Bot")
|
8 |
+
demo.launch()
|
9 |
|
10 |
+
## ROUND 2 ###
|
11 |
# import random
|
12 |
# import gradio as gr
|
13 |
|
|
|
38 |
# demo.launch()
|
39 |
|
40 |
### ROUND 4 ###
|
41 |
+
# import time
|
42 |
+
# import gradio as gr
|
43 |
|
44 |
+
# def slow_echo(message, history):
|
45 |
+
# for i in range(len(message)):
|
46 |
+
# time.sleep(0.05)
|
47 |
+
# yield "You typed: " + message[: i + 1]
|
48 |
|
49 |
+
# demo = gr.ChatInterface(
|
50 |
+
# slow_echo,
|
51 |
+
# type="messages",
|
52 |
+
# save_history=True,
|
53 |
+
# )
|
54 |
|
55 |
+
# if __name__ == "__main__":
|
56 |
+
# demo.launch()
|