Spaces:
Runtime error
Runtime error
Commit ·
59f8986
1
Parent(s): 763e61f
revert try and add main
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import os
|
|
| 4 |
from smolagents import InferenceClientModel, CodeAgent, ToolCollection, MCPClient
|
| 5 |
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
mcp_client = MCPClient(
|
| 10 |
{"url": "https://techarmour-mcp-sentiment.hf.space/gradio_api/mcp/sse"}
|
|
@@ -22,7 +22,6 @@ from smolagents import InferenceClientModel, CodeAgent, ToolCollection, MCPClien
|
|
| 22 |
description="This is a simple agent that uses MCP tools to answer questions.",
|
| 23 |
)
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
## mcp_client.disconnect()
|
|
|
|
| 4 |
from smolagents import InferenceClientModel, CodeAgent, ToolCollection, MCPClient
|
| 5 |
|
| 6 |
|
| 7 |
+
try:
|
| 8 |
|
| 9 |
mcp_client = MCPClient(
|
| 10 |
{"url": "https://techarmour-mcp-sentiment.hf.space/gradio_api/mcp/sse"}
|
|
|
|
| 22 |
description="This is a simple agent that uses MCP tools to answer questions.",
|
| 23 |
)
|
| 24 |
|
| 25 |
+
demo.launch()
|
| 26 |
+
finally:
|
| 27 |
+
mcp_client.disconnect()
|
|
|