Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import gradio as gr
|
|
| 9 |
from PIL import Image
|
| 10 |
from io import BytesIO
|
| 11 |
import base64
|
| 12 |
-
|
| 13 |
|
| 14 |
|
| 15 |
model = InferenceClientModel("qwen/Qwen2.5-0.5B-Instruct",
|
|
@@ -48,15 +48,21 @@ class ImageCaptioningTool(Tool):
|
|
| 48 |
|
| 49 |
|
| 50 |
# ---------------------- TOOL CONFIGURATION ---------------------- #
|
| 51 |
-
tools=[
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
]
|
| 58 |
|
| 59 |
-
|
| 60 |
# # ---------------------- AGENT SETUP ---------------------- #
|
| 61 |
# agent = CodeAgent(
|
| 62 |
# model = model,
|
|
|
|
| 9 |
from PIL import Image
|
| 10 |
from io import BytesIO
|
| 11 |
import base64
|
| 12 |
+
from smolagents import load_tool
|
| 13 |
|
| 14 |
|
| 15 |
model = InferenceClientModel("qwen/Qwen2.5-0.5B-Instruct",
|
|
|
|
| 48 |
|
| 49 |
|
| 50 |
# ---------------------- TOOL CONFIGURATION ---------------------- #
|
| 51 |
+
# tools=[
|
| 52 |
+
# DuckDuckGoSearchTool(max_results=5, rate_limit=2.0),
|
| 53 |
+
# WikipediaSearchTool(user_agent="my-agent", language="en"),
|
| 54 |
+
# PythonInterpreterTool(),
|
| 55 |
+
# UserInputTool(),
|
| 56 |
+
# ImageCaptioningTool(),
|
| 57 |
+
# ]
|
| 58 |
+
tools = [
|
| 59 |
+
load_tool("image-captioning", trust_remote_code=True),
|
| 60 |
+
load_tool("duckduckgo-search", trust_remote_code=True),
|
| 61 |
+
load_tool("wikipedia", trust_remote_code=True),
|
| 62 |
+
load_tool("python", trust_remote_code=True),
|
| 63 |
+
load_tool("user-input", trust_remote_code=True),
|
| 64 |
]
|
| 65 |
|
|
|
|
| 66 |
# # ---------------------- AGENT SETUP ---------------------- #
|
| 67 |
# agent = CodeAgent(
|
| 68 |
# model = model,
|