Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,6 +21,8 @@ from smolagents import (
|
|
| 21 |
ToolCollection
|
| 22 |
)
|
| 23 |
|
|
|
|
|
|
|
| 24 |
# 1. Load a powerful model (32B+)
|
| 25 |
model = TransformersModel(
|
| 26 |
model_id="Qwen/Qwen3-32B-AWQ", # Or use EXAONE-Deep-32B-GGUF, DeepSeek-R1-distill-Qwen-32B-4bit, etc.
|
|
@@ -34,16 +36,9 @@ search_tool = DuckDuckGoSearchTool()
|
|
| 34 |
python_tool = PythonInterpreterTool()
|
| 35 |
|
| 36 |
# Calculator (from Hugging Face Hub)
|
| 37 |
-
calculator_tool =
|
| 38 |
-
|
| 39 |
-
# Summarizer (from Hugging Face Hub)
|
| 40 |
-
summarizer_tool = load_tool("smol-ai/summarizer", trust_remote_code=True)
|
| 41 |
|
| 42 |
-
# Unit converter (from Hugging Face Hub)
|
| 43 |
-
unit_converter_tool = load_tool("smol-ai/unit-converter", trust_remote_code=True)
|
| 44 |
|
| 45 |
-
# Date/time tool (from Hugging Face Hub)
|
| 46 |
-
datetime_tool = load_tool("smol-ai/datetime", trust_remote_code=True)
|
| 47 |
image_tool_collection = ToolCollection.from_hub("huggingface-tools/diffusion-tools-6630bb19a942c2306a2cdb6f")
|
| 48 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 49 |
"""
|
|
|
|
| 21 |
ToolCollection
|
| 22 |
)
|
| 23 |
|
| 24 |
+
from langchain.agents import load_tools
|
| 25 |
+
|
| 26 |
# 1. Load a powerful model (32B+)
|
| 27 |
model = TransformersModel(
|
| 28 |
model_id="Qwen/Qwen3-32B-AWQ", # Or use EXAONE-Deep-32B-GGUF, DeepSeek-R1-distill-Qwen-32B-4bit, etc.
|
|
|
|
| 36 |
python_tool = PythonInterpreterTool()
|
| 37 |
|
| 38 |
# Calculator (from Hugging Face Hub)
|
| 39 |
+
calculator_tool = Tool.from_langchain(load_tools(["llm-math"])[0])
|
|
|
|
|
|
|
|
|
|
| 40 |
|
|
|
|
|
|
|
| 41 |
|
|
|
|
|
|
|
| 42 |
image_tool_collection = ToolCollection.from_hub("huggingface-tools/diffusion-tools-6630bb19a942c2306a2cdb6f")
|
| 43 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 44 |
"""
|