Spaces:
Build error
Build error
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -3,15 +3,12 @@ import requests
|
|
| 3 |
import cmath
|
| 4 |
import pytesseract
|
| 5 |
from PIL import Image
|
| 6 |
-
from smolagents import tool, FinalAnswerTool, DuckDuckGoSearchTool
|
| 7 |
|
| 8 |
|
| 9 |
DuckDuckGoSearchTool = DuckDuckGoSearchTool()
|
| 10 |
FinalAnswer = FinalAnswerTool()
|
| 11 |
|
| 12 |
-
image_tool_collection = ToolCollection.from_hub("huggingface-tools/diffusion-tools-6630bb19a942c2306a2cdb6f",
|
| 13 |
-
trust_remote_code=True)
|
| 14 |
-
|
| 15 |
## MATH TOOLS
|
| 16 |
@tool
|
| 17 |
def multiply(a: float, b: float) -> float:
|
|
@@ -128,6 +125,6 @@ def download_file_from_url(url: str, filename: Optional[str] = None) -> str:
|
|
| 128 |
return f"Error downloading file: {str(e)}"
|
| 129 |
|
| 130 |
|
| 131 |
-
all_tools = [DuckDuckGoSearchTool, FinalAnswer,
|
| 132 |
multiply, add, subtract, divide, modulus, power, square_root,
|
| 133 |
download_file_from_url]
|
|
|
|
| 3 |
import cmath
|
| 4 |
import pytesseract
|
| 5 |
from PIL import Image
|
| 6 |
+
from smolagents import tool, FinalAnswerTool, DuckDuckGoSearchTool
|
| 7 |
|
| 8 |
|
| 9 |
DuckDuckGoSearchTool = DuckDuckGoSearchTool()
|
| 10 |
FinalAnswer = FinalAnswerTool()
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
## MATH TOOLS
|
| 13 |
@tool
|
| 14 |
def multiply(a: float, b: float) -> float:
|
|
|
|
| 125 |
return f"Error downloading file: {str(e)}"
|
| 126 |
|
| 127 |
|
| 128 |
+
all_tools = [DuckDuckGoSearchTool, FinalAnswer,
|
| 129 |
multiply, add, subtract, divide, modulus, power, square_root,
|
| 130 |
download_file_from_url]
|