aliabid94 HF staff commited on
Commit
2bc74a6
1 Parent(s): b08ab7d

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +12 -3
run.py CHANGED
@@ -1,6 +1,15 @@
1
  import gradio as gr
2
 
3
- def slow_echo(message, history):
4
- return f"{len(history)}. {message}"
 
5
 
6
- demo = gr.ChatInterface(slow_echo).queue().launch()
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ with gr.Blocks() as demo:
4
+ chat = gr.Chatbot()
5
+ text = gr.Textbox()
6
 
7
+ def add(new_text, history):
8
+ return history + [[new_text, "yes"]]
9
+
10
+
11
+ text.submit(add, [text, chat], chat)
12
+
13
+ gr.LoginButton()
14
+
15
+ demo.launch()