nicholasKluge commited on
Commit
e2be348
1 Parent(s): 36fcef8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -101,7 +101,14 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped') as demo:
101
  gr.Markdown("""<h1><center>Aira Demo (Português) 🤓💬</h1></center>""")
102
  gr.Markdown(intro)
103
 
104
- chatbot = gr.Chatbot(label="Aira").style(height=500)
 
 
 
 
 
 
 
105
  msg = gr.Textbox(label="Escreva uma pergunta ou instrução para Aira ...", placeholder="Olá Aira, como vai você?")
106
 
107
  # Parameters to control the generation
@@ -139,7 +146,7 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped') as demo:
139
  """
140
  Chatbot's user message handler.
141
  """
142
- return gr.update(value=user_message, interactive=True), chat_history + [["👤 " + user_message, None]]
143
 
144
  def generate_response(user_msg, top_p, temperature, top_k, max_length, smaple_from, repetition_penalty, safety, chat_history):
145
  """
@@ -207,7 +214,7 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped') as demo:
207
  else:
208
  bot_message = ordered_generations[0][0]
209
 
210
- chat_history[-1][1] = "🤖 "
211
  for character in bot_message:
212
  chat_history[-1][1] += character
213
  time.sleep(0.005)
 
101
  gr.Markdown("""<h1><center>Aira Demo (Português) 🤓💬</h1></center>""")
102
  gr.Markdown(intro)
103
 
104
+ chatbot = gr.Chatbot(label="Aira",
105
+ height=500,
106
+ show_copy_button=True,
107
+ avatar_images=("./astronaut.png", "./robot.png"),
108
+ render_markdown= True,
109
+ line_breaks=True,
110
+ likeable=False,
111
+ layout='panel')
112
  msg = gr.Textbox(label="Escreva uma pergunta ou instrução para Aira ...", placeholder="Olá Aira, como vai você?")
113
 
114
  # Parameters to control the generation
 
146
  """
147
  Chatbot's user message handler.
148
  """
149
+ return gr.update(value=user_message, interactive=True), chat_history + [[user_message, None]]
150
 
151
  def generate_response(user_msg, top_p, temperature, top_k, max_length, smaple_from, repetition_penalty, safety, chat_history):
152
  """
 
214
  else:
215
  bot_message = ordered_generations[0][0]
216
 
217
+ chat_history[-1][1] = ""
218
  for character in bot_message:
219
  chat_history[-1][1] += character
220
  time.sleep(0.005)