HemanM commited on
Commit
cb1e60f
Β·
verified Β·
1 Parent(s): 11f2d5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -16
app.py CHANGED
@@ -5,8 +5,8 @@ import retrain
5
  import pandas as pd
6
  import os
7
 
8
- def advisor_interface(query, context, file, feedback_choice):
9
- evo_output, evo_reasoning = get_evo_response(query, context, file)
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 – Retrieval-Augmented Adaptive AI (General Purpose)")
30
 
31
  with gr.Row():
32
- query = gr.Textbox(label="πŸ“ Ask any question", placeholder="e.g. What are the effects of inflation?")
33
- context = gr.Textbox(label="πŸ“‚ Optional background notes or memos", placeholder="Paste policy, notes, or ideas...")
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)", lines=6)
43
- gpt_out = gr.Textbox(label="πŸ€– GPT-3.5 Suggestion", lines=6)
44
 
45
  run_button = gr.Button("Run Advisors")
46
- history_output = gr.Textbox(label="πŸ“œ Recent History")
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 on Feedback")
52
  retrain_button = gr.Button("πŸ“š Retrain Evo")
53
- retrain_status = gr.Textbox(label="πŸ› οΈ Retrain Status")
 
54
 
55
- retrain_button.click(fn=retrain_evo, inputs=[], outputs=[retrain_status, history_output])
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()