fschwartzer commited on
Commit
29771a3
·
verified ·
1 Parent(s): 78047da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -7,13 +7,14 @@ processing = False
7
  def response(query, history):
8
  global processing
9
  processing = True
10
- output = generate_answers(query)
 
11
  history.append((query, output))
12
  processing = False
13
  return "", history
14
 
15
  def loading():
16
- return "Loading ..."
17
 
18
 
19
  with gr.Blocks(css=css) as app:
@@ -21,10 +22,10 @@ with gr.Blocks(css=css) as app:
21
  gr.HTML(title_html)
22
  chatbot = gr.Chatbot([], elem_id="chatbot")
23
  with gr.Column():
24
- send = gr.Label(value="Write your QUESTION bellow and hit ENTER")
25
  query = gr.Textbox(
26
- label="Type your questions here:",
27
- placeholder="What do you want to know?",
28
  )
29
  clear = gr.ClearButton([query, chatbot])
30
  gr.HTML(bts_html)
 
7
  def response(query, history):
8
  global processing
9
  processing = True
10
+ prompt = f"Analyze the following data to answer the question: {data.head().to_string(index=False)}\nQuestion: {query}\nAnswer:"
11
+ output = generate_answers(prompt)
12
  history.append((query, output))
13
  processing = False
14
  return "", history
15
 
16
  def loading():
17
+ return "Carregando ..."
18
 
19
 
20
  with gr.Blocks(css=css) as app:
 
22
  gr.HTML(title_html)
23
  chatbot = gr.Chatbot([], elem_id="chatbot")
24
  with gr.Column():
25
+ send = gr.Label(value="Escreva sua QUESTÃO abaixo e pressione ENTER")
26
  query = gr.Textbox(
27
+ label="Escreva sua questão aqui:",
28
+ placeholder="Sobre o que você quer saber?",
29
  )
30
  clear = gr.ClearButton([query, chatbot])
31
  gr.HTML(bts_html)