jatinror commited on
Commit
29fe67c
·
verified ·
1 Parent(s): b7b1009

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -117,24 +117,25 @@ def run_agent():
117
  print("Finished submission.")
118
 
119
  # ===============================
120
- # GRADIO INTERFACE (GUARANTEES RUN BUTTON)
121
  # ===============================
122
 
123
- def run_pipeline(dummy_button):
124
  try:
125
  run_agent()
126
  return "✅ GAIA submission completed. Check leaderboard."
127
  except Exception as e:
128
  return f"❌ Error occurred: {str(e)}"
129
 
130
- # Use a dummy button as input to force Run button to appear
131
- demo = gr.Interface(
132
- fn=run_pipeline,
133
- inputs=gr.Button("Run GAIA Agent"), # <- this creates the Run button
134
- outputs="text",
135
- title="GAIA Final Assignment Agent",
136
- description="Click the button to execute your GAIA agent and submit answers."
137
- )
 
138
 
139
  if __name__ == "__main__":
140
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
117
  print("Finished submission.")
118
 
119
  # ===============================
120
+ # GRADIO UI
121
  # ===============================
122
 
123
+ def run_pipeline():
124
  try:
125
  run_agent()
126
  return "✅ GAIA submission completed. Check leaderboard."
127
  except Exception as e:
128
  return f"❌ Error occurred: {str(e)}"
129
 
130
+ # Create a simple text output
131
+ output_text = gr.Textbox(label="Output", lines=4)
132
+
133
+ # Create a button and link it to the function
134
+ run_button = gr.Button("Run GAIA Agent")
135
+ run_button.click(fn=run_pipeline, inputs=[], outputs=output_text)
136
+
137
+ # Launch the interface
138
+ demo = gr.Row([run_button, output_text])
139
 
140
  if __name__ == "__main__":
141
  demo.launch(server_name="0.0.0.0", server_port=7860)