Spaces:
Runtime error
Runtime error
Add core project files and ignore secrets
Browse files
app.py
CHANGED
|
@@ -14,14 +14,17 @@ try:
|
|
| 14 |
structured_output=True
|
| 15 |
)
|
| 16 |
tools = mcp_client.get_tools()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
# model = InferenceClientModel(token=os.getenv("HUGGINGFACE_API_TOKEN"))
|
| 19 |
-
model = InferenceClientModel(token=os.getenv("HUGGINGFACE_API_TOKEN"))
|
| 20 |
agent = CodeAgent(tools=[*tools], model=model, additional_authorized_imports=["json", "ast", "urllib", "base64"])
|
| 21 |
|
| 22 |
demo = gr.ChatInterface(
|
| 23 |
fn=lambda message, history: str(agent.run(message)),
|
| 24 |
-
# type="messages"
|
| 25 |
examples=["Analyze the sentiment of the following text 'This is awesome'"],
|
| 26 |
title="Agent with MCP Tools",
|
| 27 |
description="This is a simple agent that uses MCP tools to answer questions.",
|
|
|
|
| 14 |
structured_output=True
|
| 15 |
)
|
| 16 |
tools = mcp_client.get_tools()
|
| 17 |
+
|
| 18 |
+
model = InferenceClientModel(
|
| 19 |
+
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 20 |
+
token=os.getenv("HUGGINGFACE_API_TOKEN")
|
| 21 |
+
)
|
| 22 |
|
|
|
|
|
|
|
| 23 |
agent = CodeAgent(tools=[*tools], model=model, additional_authorized_imports=["json", "ast", "urllib", "base64"])
|
| 24 |
|
| 25 |
demo = gr.ChatInterface(
|
| 26 |
fn=lambda message, history: str(agent.run(message)),
|
| 27 |
+
# 移除 type="messages"
|
| 28 |
examples=["Analyze the sentiment of the following text 'This is awesome'"],
|
| 29 |
title="Agent with MCP Tools",
|
| 30 |
description="This is a simple agent that uses MCP tools to answer questions.",
|