Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,8 +20,8 @@ def get_context_func(question, context_output):
|
|
20 |
result = query(payload)
|
21 |
context_output.update(result['answer'])
|
22 |
|
23 |
-
def ask_ai(question,
|
24 |
-
payload = {"question": question, "context":
|
25 |
result = query2(payload)
|
26 |
answer_output.update(result['answer'])
|
27 |
|
@@ -31,9 +31,6 @@ iface = gr.Interface(
|
|
31 |
gr.Textbox("Question"),
|
32 |
gr.Textbox("Context"),
|
33 |
gr.Button("get_context", get_context_func),
|
34 |
-
gr.Button("ask_ai")
|
35 |
-
],
|
36 |
-
outputs=gr.Textbox("Answer"),
|
37 |
-
)
|
38 |
|
39 |
iface.launch()
|
|
|
20 |
result = query(payload)
|
21 |
context_output.update(result['answer'])
|
22 |
|
23 |
+
def ask_ai(question, context_output, answer_output):
|
24 |
+
payload = {"question": question, "context": context_output.value}
|
25 |
result = query2(payload)
|
26 |
answer_output.update(result['answer'])
|
27 |
|
|
|
31 |
gr.Textbox("Question"),
|
32 |
gr.Textbox("Context"),
|
33 |
gr.Button("get_context", get_context_func),
|
34 |
+
gr.Button("ask_ai", live=False) # Setting live to False for manual control of updates
|
|
|
|
|
|
|
35 |
|
36 |
iface.launch()
|