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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -117,7 +117,7 @@ def run_agent():
117
  print("Finished submission.")
118
 
119
  # ===============================
120
- # GRADIO UI
121
  # ===============================
122
 
123
  def run_pipeline():
@@ -127,15 +127,12 @@ def run_pipeline():
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)
 
117
  print("Finished submission.")
118
 
119
  # ===============================
120
+ # GRADIO BLOCKS UI
121
  # ===============================
122
 
123
  def run_pipeline():
 
127
  except Exception as e:
128
  return f"❌ Error occurred: {str(e)}"
129
 
130
+ with gr.Blocks() as demo:
131
+ run_button = gr.Button("Run GAIA Agent")
132
+ output_text = gr.Textbox(label="Output", lines=4)
133
+
134
+ # Link button click to function
135
+ run_button.click(fn=run_pipeline, inputs=[], outputs=output_text)
 
 
 
136
 
137
  if __name__ == "__main__":
138
  demo.launch(server_name="0.0.0.0", server_port=7860)