Spaces:
Runtime error
Runtime error
Create planner.py
Browse files- planner.py +16 -0
planner.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# planner.py
|
| 2 |
+
from gradio_client import Client
|
| 3 |
+
|
| 4 |
+
# Connect to your Hugging Face Space
|
| 5 |
+
client = Client("shreyab21/aegis-reasoner")
|
| 6 |
+
|
| 7 |
+
def llama_reason(query: str) -> str:
|
| 8 |
+
"""
|
| 9 |
+
Sends the query to the remote Reasoner Space (on Hugging Face)
|
| 10 |
+
and returns the generated reasoning response.
|
| 11 |
+
"""
|
| 12 |
+
try:
|
| 13 |
+
result = client.predict(query=query, api_name="/predict")
|
| 14 |
+
return result
|
| 15 |
+
except Exception as e:
|
| 16 |
+
return f"⚠️ Reasoner error: {e}"
|