Spaces:
Sleeping
Sleeping
JCentercreation
commited on
Commit
·
f867be3
1
Parent(s):
8db71b7
Fix
Browse files
app.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
|
4 |
-
from
|
5 |
-
from smolagents import InferenceClientModel, CodeAgent, ToolCollection, MCPClient
|
6 |
|
7 |
try:
|
8 |
mcp_client = MCPClient(
|
@@ -15,7 +14,7 @@ try:
|
|
15 |
|
16 |
model = InferenceClientModel(token=os.getenv("HF_TOKEN"))
|
17 |
|
18 |
-
agent = CodeAgent(tools=[*tools], model=model, additional_authorized_imports=["json", "ast", "urllib", "base64")
|
19 |
|
20 |
demo = gr.ChatInterface(
|
21 |
fn= lambda message, history: str(agent.run(message)),
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
|
4 |
+
from smolagents import InferenceClientModel, CodeAgent, MCPClient
|
|
|
5 |
|
6 |
try:
|
7 |
mcp_client = MCPClient(
|
|
|
14 |
|
15 |
model = InferenceClientModel(token=os.getenv("HF_TOKEN"))
|
16 |
|
17 |
+
agent = CodeAgent(tools=[*tools], model=model, additional_authorized_imports=["json", "ast", "urllib", "base64"])
|
18 |
|
19 |
demo = gr.ChatInterface(
|
20 |
fn= lambda message, history: str(agent.run(message)),
|