itskavya commited on
Commit
fa4aaf0
·
verified ·
1 Parent(s): c381ebe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -194,6 +194,14 @@ if __name__ == "__main__":
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
 
 
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
+ try:
198
+ agent = BasicAgent()
199
+ except Exception as e:
200
+ print(f"Error instantiating agent: {e}")
201
+ return f"Error initializing agent: {e}", None
202
+ # In the case of an app running as a hugging Face space, this link points toward your codebase ( usefull for others so please keep it public)
203
+ agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
204
+ print(agent_code)
205
  else:
206
  print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
207