alisamak commited on
Commit
888b56f
·
verified ·
1 Parent(s): 83f7ed5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -36
app.py CHANGED
@@ -173,41 +173,38 @@ with gr.Blocks() as demo:
173
  # outputs=[status_output, results_table]
174
  # )
175
 
 
176
  if __name__ == "__main__":
177
- agent = BasicAgent()
178
- evaluate_agent(agent, test_questions)
179
-
180
- # if __name__ == "__main__":
181
- # print("\n" + "-"*30 + " App Starting " + "-"*30)
182
-
183
- # agent = BasicAgent() #sanity check
184
- # test_questions = [
185
- # "What is 2 + 2?",
186
- # "What is the capital of Japan?",
187
- # "Who is the CEO of Tesla?",
188
- # ]
189
- # for q in test_questions:
190
- # print(f"Q: {q}")
191
- # print(f"A: {agent(q)}")
192
 
193
- # # Check for SPACE_HOST and SPACE_ID at startup for information
194
- # space_host_startup = os.getenv("SPACE_HOST")
195
- # space_id_startup = os.getenv("SPACE_ID") # Get SPACE_ID at startup
196
-
197
- # if space_host_startup:
198
- # print(f"✅ SPACE_HOST found: {space_host_startup}")
199
- # print(f" Runtime URL should be: https://{space_host_startup}.hf.space")
200
- # else:
201
- # print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
202
-
203
- # if space_id_startup: # Print repo URLs if SPACE_ID is found
204
- # print(f"✅ SPACE_ID found: {space_id_startup}")
205
- # print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
206
- # print(f" Repo Tree URL: https://huggingface.co/spaces/{space_id_startup}/tree/main")
207
- # else:
208
- # print("ℹ️ SPACE_ID environment variable not found (running locally?). Repo URL cannot be determined.")
209
-
210
- # print("-"*(60 + len(" App Starting ")) + "\n")
211
-
212
- # print("Launching Gradio Interface for Basic Agent Evaluation...")
213
- # demo.launch(debug=True, share=False)
 
173
  # outputs=[status_output, results_table]
174
  # )
175
 
176
+
177
  if __name__ == "__main__":
178
+ print("\n" + "-"*30 + " App Starting " + "-"*30)
179
+
180
+ agent = BasicAgent() #sanity check
181
+ test_questions = [
182
+ "What is 2 + 2?",
183
+ "What is the capital of Japan?",
184
+ "Who is the CEO of Tesla?",
185
+ ]
186
+ for q in test_questions:
187
+ print(f"Q: {q}")
188
+ print(f"A: {agent(q)}")
 
 
 
 
189
 
190
+ # Check for SPACE_HOST and SPACE_ID at startup for information
191
+ space_host_startup = os.getenv("SPACE_HOST")
192
+ space_id_startup = os.getenv("SPACE_ID") # Get SPACE_ID at startup
193
+
194
+ if space_host_startup:
195
+ print(f"✅ SPACE_HOST found: {space_host_startup}")
196
+ print(f" Runtime URL should be: https://{space_host_startup}.hf.space")
197
+ else:
198
+ print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
199
+
200
+ if space_id_startup: # Print repo URLs if SPACE_ID is found
201
+ print(f"✅ SPACE_ID found: {space_id_startup}")
202
+ print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
203
+ print(f" Repo Tree URL: https://huggingface.co/spaces/{space_id_startup}/tree/main")
204
+ else:
205
+ print("ℹ️ SPACE_ID environment variable not found (running locally?). Repo URL cannot be determined.")
206
+
207
+ print("-"*(60 + len(" App Starting ")) + "\n")
208
+
209
+ print("Launching Gradio Interface for Basic Agent Evaluation...")
210
+ demo.launch(debug=True, share=False)