fcernafukuzaki commited on
Commit
f3ceecb
1 Parent(s): 82dca84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -100,21 +100,19 @@ def chat(pregunta):
100
  time.sleep(1)
101
  return chat_history
102
 
103
- def new_chat():
104
- chat_history = []
105
 
106
  with gr.Blocks() as demo:
107
- gr.Markdown(
108
- f"""<p><center><h1>Demo Inmobiliaria</h1></p></center>
109
  {description}
110
  """)
111
 
112
-
113
- out1 = gr.Chatbot(label="Respuesta").style(height=350)
114
- in2 = gr.Textbox(label="Pregunta")
 
115
 
116
  clear = gr.Button("Nuevo chat")
117
- clear.click(fn=new_chat, inputs=None, outputs=None)
118
 
119
  gr.Markdown(article)
120
 
@@ -124,6 +122,7 @@ with gr.Blocks() as demo:
124
  time.sleep(1)
125
  return "", chat_history
126
 
 
127
  in2.submit(respond, [in2, out1], [in2, out1])
128
  clear.click(lambda: None, None, out1, queue=False)
129
 
 
100
  time.sleep(1)
101
  return chat_history
102
 
 
 
103
 
104
  with gr.Blocks() as demo:
105
+ gr.Markdown(f"""
106
+ <p><center><h1>Demo Inmobiliaria</h1></p></center>
107
  {description}
108
  """)
109
 
110
+ out1 = gr.Chatbot(label="Respuesta").style(height=300)
111
+ with gr.Row():
112
+ in2 = gr.Textbox(label="Pregunta")
113
+ enter = gr.Button("Enviar mensaje")
114
 
115
  clear = gr.Button("Nuevo chat")
 
116
 
117
  gr.Markdown(article)
118
 
 
122
  time.sleep(1)
123
  return "", chat_history
124
 
125
+ enter.click(fn=respond, inputs=[in2, out1], outputs=[in2, out1])
126
  in2.submit(respond, [in2, out1], [in2, out1])
127
  clear.click(lambda: None, None, out1, queue=False)
128