Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
|