Update app.py
Browse files
app.py
CHANGED
@@ -38,35 +38,15 @@ def invoke(question, level, ground_truth, file_name, openai_api_key, gemini_api_
|
|
38 |
return answer
|
39 |
|
40 |
def clear():
|
41 |
-
#answer = gr.Textbox(elem_id="answer")
|
42 |
-
#answer.value = ""
|
43 |
return ""
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
"""
|
48 |
-
gaia = gr.Interface(fn=invoke,
|
49 |
-
inputs=[gr.Radio([1, 2, 3], label="Level", value=int(os.environ["INPUT_LEVEL"])),
|
50 |
-
gr.Textbox(label="Question *", value=os.environ["INPUT_QUESTION"]),
|
51 |
-
gr.Textbox(label="File Name"),
|
52 |
-
gr.Textbox(label="Ground Truth", value=os.environ["INPUT_GROUND_TRUTH"]),
|
53 |
-
gr.Textbox(label="OpenAI API Key *", type="password"),
|
54 |
-
gr.Textbox(label="Gemini API Key *", type="password")],
|
55 |
-
outputs=[gr.Textbox(label="Answer", lines=1, interactive=False, value=os.environ["OUTPUT"])],
|
56 |
-
title="General AI Assistant - GAIA π€π€π€",
|
57 |
-
description=os.environ["DESCRIPTION"],
|
58 |
-
examples=get_questions(QUESTION_FILE_PATH, QUESTION_LEVEL),
|
59 |
-
cache_examples=False
|
60 |
-
)
|
61 |
-
|
62 |
-
gaia.launch()
|
63 |
-
"""
|
64 |
|
65 |
examples = get_questions(QUESTION_FILE_PATH, QUESTION_LEVEL)
|
66 |
|
67 |
with gr.Blocks(title="GAIA") as gaia:
|
68 |
gr.Markdown("## General AI Assistant - GAIA π€π€π€")
|
69 |
-
gr.Markdown(os.environ.get("DESCRIPTION"
|
70 |
|
71 |
with gr.Row():
|
72 |
with gr.Column(scale=3):
|
@@ -107,7 +87,6 @@ with gr.Blocks(title="GAIA") as gaia:
|
|
107 |
submit_btn = gr.Button("Submit", variant="primary")
|
108 |
with gr.Column(scale=1):
|
109 |
answer = gr.Textbox(
|
110 |
-
elem_id="answer",
|
111 |
label="Answer",
|
112 |
lines=1,
|
113 |
interactive=False,
|
|
|
38 |
return answer
|
39 |
|
40 |
def clear():
|
|
|
|
|
41 |
return ""
|
42 |
|
43 |
+
gr.close_all()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
examples = get_questions(QUESTION_FILE_PATH, QUESTION_LEVEL)
|
46 |
|
47 |
with gr.Blocks(title="GAIA") as gaia:
|
48 |
gr.Markdown("## General AI Assistant - GAIA π€π€π€")
|
49 |
+
gr.Markdown(os.environ.get("DESCRIPTION"))
|
50 |
|
51 |
with gr.Row():
|
52 |
with gr.Column(scale=3):
|
|
|
87 |
submit_btn = gr.Button("Submit", variant="primary")
|
88 |
with gr.Column(scale=1):
|
89 |
answer = gr.Textbox(
|
|
|
90 |
label="Answer",
|
91 |
lines=1,
|
92 |
interactive=False,
|