Spaces:
Paused
Paused
ggsmith842
commited on
Commit
·
9978fe9
1
Parent(s):
b918492
update code
Browse files
app.py
CHANGED
@@ -1,17 +1,16 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
|
4 |
-
from mcp
|
5 |
-
from smolagents import InferenceClientModel, CodeAgent, ToolCollection
|
6 |
-
|
|
|
7 |
|
8 |
|
9 |
token = os.getenv("HF_TOKEN")
|
10 |
if token:
|
11 |
print(f"Token set: {token[:3]}...")
|
12 |
|
13 |
-
|
14 |
-
|
15 |
try:
|
16 |
mcp_client = MCPClient(
|
17 |
## Try this working example on the hub:
|
@@ -20,7 +19,7 @@ try:
|
|
20 |
)
|
21 |
tools = mcp_client.get_tools()
|
22 |
|
23 |
-
model = InferenceClientModel(
|
24 |
agent = CodeAgent(tools=[*tools], model=model)
|
25 |
|
26 |
demo = gr.ChatInterface(
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
|
4 |
+
from mcp import StdioServerParameters
|
5 |
+
from smolagents import InferenceClientModel, CodeAgent, ToolCollection, MCPClient
|
6 |
+
|
7 |
+
|
8 |
|
9 |
|
10 |
token = os.getenv("HF_TOKEN")
|
11 |
if token:
|
12 |
print(f"Token set: {token[:3]}...")
|
13 |
|
|
|
|
|
14 |
try:
|
15 |
mcp_client = MCPClient(
|
16 |
## Try this working example on the hub:
|
|
|
19 |
)
|
20 |
tools = mcp_client.get_tools()
|
21 |
|
22 |
+
model = InferenceClientModel(token=os.getenv("HF_TOKEN"))
|
23 |
agent = CodeAgent(tools=[*tools], model=model)
|
24 |
|
25 |
demo = gr.ChatInterface(
|