Spaces:
Paused
Paused
ggsmith842
commited on
Commit
·
de1645f
1
Parent(s):
63b4097
add credentials
Browse files- .gitignore +2 -1
- app.py +5 -1
.gitignore
CHANGED
|
@@ -1 +1,2 @@
|
|
| 1 |
-
venv
|
|
|
|
|
|
| 1 |
+
venv
|
| 2 |
+
.env
|
app.py
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
| 3 |
from mcp.client.stdio import StdioServerParameters
|
| 4 |
from smolagents import InferenceClientModel, CodeAgent, ToolCollection
|
| 5 |
from smolagents.mcp_client import MCPClient
|
| 6 |
|
|
|
|
|
|
|
| 7 |
try:
|
| 8 |
mcp_client = MCPClient(
|
| 9 |
## Try this working example on the hub:
|
|
@@ -12,7 +16,7 @@ try:
|
|
| 12 |
)
|
| 13 |
tools = mcp_client.get_tools()
|
| 14 |
|
| 15 |
-
model = InferenceClientModel()
|
| 16 |
agent = CodeAgent(tools=[*tools], model=model)
|
| 17 |
|
| 18 |
demo = gr.ChatInterface(
|
|
|
|
| 1 |
+
import os
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
|
| 5 |
from mcp.client.stdio import StdioServerParameters
|
| 6 |
from smolagents import InferenceClientModel, CodeAgent, ToolCollection
|
| 7 |
from smolagents.mcp_client import MCPClient
|
| 8 |
|
| 9 |
+
token = os.environ.get("HF_TOKEN")
|
| 10 |
+
|
| 11 |
try:
|
| 12 |
mcp_client = MCPClient(
|
| 13 |
## Try this working example on the hub:
|
|
|
|
| 16 |
)
|
| 17 |
tools = mcp_client.get_tools()
|
| 18 |
|
| 19 |
+
model = InferenceClientModel(token=token)
|
| 20 |
agent = CodeAgent(tools=[*tools], model=model)
|
| 21 |
|
| 22 |
demo = gr.ChatInterface(
|