Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
|
|
3 |
from mcp.client.stdio import StdioServerParameters
|
4 |
from smolagents import InferenceClientModel, CodeAgent
|
5 |
from smolagents.mcp_client import MCPClient
|
|
|
6 |
|
7 |
# Initialize the MCP client correctly
|
8 |
try:
|
@@ -14,7 +15,8 @@ try:
|
|
14 |
|
15 |
tools = mcp_client.get_tools()
|
16 |
|
17 |
-
model = InferenceClientModel()
|
|
|
18 |
agent = CodeAgent(tools=[*tools], model=model)
|
19 |
|
20 |
# Define Gradio ChatInterface
|
|
|
3 |
from mcp.client.stdio import StdioServerParameters
|
4 |
from smolagents import InferenceClientModel, CodeAgent
|
5 |
from smolagents.mcp_client import MCPClient
|
6 |
+
from transformers import pipeline
|
7 |
|
8 |
# Initialize the MCP client correctly
|
9 |
try:
|
|
|
15 |
|
16 |
tools = mcp_client.get_tools()
|
17 |
|
18 |
+
# model = InferenceClientModel()
|
19 |
+
model = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v1.0", device_map="auto")
|
20 |
agent = CodeAgent(tools=[*tools], model=model)
|
21 |
|
22 |
# Define Gradio ChatInterface
|