bstraehle commited on
Commit
9456aa5
Β·
verified Β·
1 Parent(s): 25753bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -39,18 +39,18 @@ def invoke(level, question, file_name, ground_truth, openai_api_key, gemini_api_
39
 
40
  gr.close_all()
41
 
42
- demo = gr.Interface(fn=invoke,
43
- inputs=[gr.Radio([1, 2, 3], label="Level", value=int(os.environ["INPUT_LEVEL"])),
44
- gr.Textbox(label="Question *", value=os.environ["INPUT_QUESTION"]),
45
- gr.Textbox(label="File Name"),
46
- gr.Textbox(label="Ground Truth", value=os.environ["INPUT_GROUND_TRUTH"]),
47
- gr.Textbox(label="OpenAI API Key *", type="password"),
48
- gr.Textbox(label="Gemini API Key *", type="password")],
49
- outputs=[gr.Textbox(label="Answer", lines=1, interactive=False, value=os.environ["OUTPUT"])],
50
- title="General AI Assistant - GAIA πŸ€–πŸ€πŸ€–",
51
- description=os.environ["DESCRIPTION"],
52
- examples=get_questions(QUESTION_FILE_PATH, QUESTION_LEVEL),
53
- cache_examples=False
54
- )
55
-
56
- demo.launch()
 
39
 
40
  gr.close_all()
41
 
42
+ with gr.Blocks() as gaia:
43
+ gr.Radio([1, 2, 3], label="Level", value=int(os.environ["INPUT_LEVEL"]))
44
+ gr.Markdown(label="Question *", value=os.environ["INPUT_QUESTION"])
45
+ gr.Textbox(label="File Name")
46
+ gr.Textbox(label="Ground Truth", value=os.environ["INPUT_GROUND_TRUTH"])
47
+ with gr.Row():
48
+ gr.Textbox(label="OpenAI API Key *", type="password")
49
+ gr.Textbox(label="Gemini API Key *", type="password")
50
+ gr.Textbox(label="Answer", lines=1, interactive=False, value=os.environ["OUTPUT"])
51
+ gr.Markdown("# General AI Assistant - GAIA πŸ€–πŸ€πŸ€–")
52
+ gr.Markdown(os.environ["DESCRIPTION"])
53
+
54
+ # For examples, you may need to add a custom button or logic
55
+
56
+ gaia.launch()