Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -304,4 +304,28 @@ Be thorough in your analysis but concise in your final answer."""
|
|
| 304 |
if len(answer.split()) <= 3:
|
| 305 |
answer = answer.strip('"\'.')
|
| 306 |
|
| 307 |
-
return answer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 304 |
if len(answer.split()) <= 3:
|
| 305 |
answer = answer.strip('"\'.')
|
| 306 |
|
| 307 |
+
return answer
|
| 308 |
+
|
| 309 |
+
|
| 310 |
+
import gradio as gr
|
| 311 |
+
|
| 312 |
+
# Create a single global agent instance
|
| 313 |
+
agent = GaiaAgent()
|
| 314 |
+
|
| 315 |
+
def run_agent(prompt: str) -> str:
|
| 316 |
+
"""
|
| 317 |
+
Simple wrapper so GAIA and Hugging Face Spaces can call the agent.
|
| 318 |
+
GAIA usually passes only a prompt (not task_id), so we use a dummy ID.
|
| 319 |
+
"""
|
| 320 |
+
return agent("gaia_task", prompt)
|
| 321 |
+
|
| 322 |
+
# Expose via Gradio
|
| 323 |
+
demo = gr.Interface(
|
| 324 |
+
fn=run_agent,
|
| 325 |
+
inputs="text",
|
| 326 |
+
outputs="text",
|
| 327 |
+
title="GAIA Agent"
|
| 328 |
+
)
|
| 329 |
+
|
| 330 |
+
if __name__ == "__main__":
|
| 331 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|