Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ import retrain
|
|
5 |
import pandas as pd
|
6 |
import os
|
7 |
|
8 |
-
def advisor_interface(query, context,
|
9 |
-
evo_output, evo_reasoning = get_evo_response(query, context
|
10 |
gpt_output = get_gpt_response(query, context)
|
11 |
|
12 |
if feedback_choice != "No feedback":
|
@@ -26,32 +26,28 @@ def load_history():
|
|
26 |
return "No history available yet."
|
27 |
|
28 |
with gr.Blocks() as demo:
|
29 |
-
gr.Markdown("## π§ EvoRAG β
|
30 |
|
31 |
with gr.Row():
|
32 |
-
query = gr.Textbox(label="π Ask
|
33 |
-
context = gr.Textbox(label="π Optional
|
34 |
-
|
35 |
-
with gr.Row():
|
36 |
-
file = gr.File(label="π Upload optional file (.txt or .pdf)", file_types=[".txt", ".pdf"])
|
37 |
|
38 |
with gr.Row():
|
39 |
feedback = gr.Radio(["π Helpful", "π Not Helpful", "No feedback"], label="Was Evoβs answer useful?", value="No feedback")
|
40 |
|
41 |
with gr.Row():
|
42 |
-
evo_out = gr.Textbox(label="π¬ EvoRAG Suggestion (with reasoning)"
|
43 |
-
gpt_out = gr.Textbox(label="π€ GPT-3.5 Suggestion"
|
44 |
|
45 |
run_button = gr.Button("Run Advisors")
|
46 |
-
|
47 |
-
|
48 |
-
run_button.click(fn=advisor_interface, inputs=[query, context, file, feedback], outputs=[evo_out, gpt_out, history_output])
|
49 |
|
50 |
gr.Markdown("---")
|
51 |
-
gr.Markdown("### π Retrain Evo
|
52 |
retrain_button = gr.Button("π Retrain Evo")
|
53 |
-
|
|
|
54 |
|
55 |
-
retrain_button.click(fn=retrain_evo, inputs=[], outputs=[
|
56 |
|
57 |
demo.launch()
|
|
|
5 |
import pandas as pd
|
6 |
import os
|
7 |
|
8 |
+
def advisor_interface(query, context, feedback_choice):
|
9 |
+
evo_output, evo_reasoning = get_evo_response(query, context)
|
10 |
gpt_output = get_gpt_response(query, context)
|
11 |
|
12 |
if feedback_choice != "No feedback":
|
|
|
26 |
return "No history available yet."
|
27 |
|
28 |
with gr.Blocks() as demo:
|
29 |
+
gr.Markdown("## π§ EvoRAG β General-Purpose Adaptive AI with RAG + Web Search")
|
30 |
|
31 |
with gr.Row():
|
32 |
+
query = gr.Textbox(label="π Ask anything", placeholder="e.g. What are the latest trends in AI regulation?")
|
33 |
+
context = gr.Textbox(label="π Optional Context or Notes", placeholder="Paste any relevant information or leave blank.")
|
|
|
|
|
|
|
34 |
|
35 |
with gr.Row():
|
36 |
feedback = gr.Radio(["π Helpful", "π Not Helpful", "No feedback"], label="Was Evoβs answer useful?", value="No feedback")
|
37 |
|
38 |
with gr.Row():
|
39 |
+
evo_out = gr.Textbox(label="π¬ EvoRAG Suggestion (with reasoning)")
|
40 |
+
gpt_out = gr.Textbox(label="π€ GPT-3.5 Suggestion")
|
41 |
|
42 |
run_button = gr.Button("Run Advisors")
|
43 |
+
run_button.click(fn=advisor_interface, inputs=[query, context, feedback], outputs=[evo_out, gpt_out, gr.Textbox(label="π Recent History")])
|
|
|
|
|
44 |
|
45 |
gr.Markdown("---")
|
46 |
+
gr.Markdown("### π Retrain Evo from Feedback")
|
47 |
retrain_button = gr.Button("π Retrain Evo")
|
48 |
+
retrain_output = gr.Textbox(label="π οΈ Retrain Status")
|
49 |
+
history_output = gr.Textbox(label="π Recent History")
|
50 |
|
51 |
+
retrain_button.click(fn=retrain_evo, inputs=[], outputs=[retrain_output, history_output])
|
52 |
|
53 |
demo.launch()
|