Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os, threading
|
| 3 |
|
| 4 |
-
from agent import run_agent
|
| 5 |
from helper import get_questions
|
| 6 |
|
| 7 |
LEVEL = 1
|
|
@@ -23,9 +23,10 @@ def invoke(level, question, file_name, ground_truth, openai_api_key):
|
|
| 23 |
|
| 24 |
with lock:
|
| 25 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
| 26 |
-
|
|
|
|
| 27 |
del os.environ["OPENAI_API_KEY"]
|
| 28 |
-
return
|
| 29 |
|
| 30 |
gr.close_all()
|
| 31 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os, threading
|
| 3 |
|
| 4 |
+
from agent import run_agent, get_final_answer
|
| 5 |
from helper import get_questions
|
| 6 |
|
| 7 |
LEVEL = 1
|
|
|
|
| 23 |
|
| 24 |
with lock:
|
| 25 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
| 26 |
+
answer, matches_ground_truth = run_agent(level, question, file_name, ground_truth)
|
| 27 |
+
final_answer = get_final_answer(question, answer)
|
| 28 |
del os.environ["OPENAI_API_KEY"]
|
| 29 |
+
return final_answer, matches_ground_truth
|
| 30 |
|
| 31 |
gr.close_all()
|
| 32 |
|