Spaces:
Sleeping
Sleeping
fschwartzer
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -7,13 +7,14 @@ processing = False
|
|
7 |
def response(query, history):
|
8 |
global processing
|
9 |
processing = True
|
10 |
-
|
|
|
11 |
history.append((query, output))
|
12 |
processing = False
|
13 |
return "", history
|
14 |
|
15 |
def loading():
|
16 |
-
return "
|
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="
|
25 |
query = gr.Textbox(
|
26 |
-
label="
|
27 |
-
placeholder="
|
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)
|