Spaces:
Sleeping
Sleeping
Download tools/mathTools.py from politeles/Final_Assignment_Template: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/spaces/politeles/Final_Assignment_Template/resolve/main/tools/mathTools.py
- Command line
-
hf download hf://spaces/politeles/Final_Assignment_Template/tools/mathTools.py
-
curl -L -o mathTools.py https://huggingface.co/spaces/politeles/Final_Assignment_Template/resolve/main/tools/mathTools.py
863 Bytes
| from smolagents import tool | |
| def multiply(a: int, b: int) -> int: | |
| """Multiply two numbers. | |
| Args: | |
| a: first int | |
| b: second int | |
| """ | |
| return a * b | |
| def add(a: int, b: int) -> int: | |
| """Add two numbers. | |
| Args: | |
| a: first int | |
| b: second int | |
| """ | |
| return a + b | |
| def subtract(a: int, b: int) -> int: | |
| """Subtract two numbers. | |
| Args: | |
| a: first int | |
| b: second int | |
| """ | |
| return a - b | |
| def divide(a: int, b: int) -> int: | |
| """Divide two numbers. | |
| Args: | |
| a: first int | |
| b: second int | |
| """ | |
| if b == 0: | |
| raise ValueError("Cannot divide by zero.") | |
| return a / b | |
| def modulus(a: int, b: int) -> int: | |
| """Get the modulus of two numbers. | |
| Args: | |
| a: first int | |
| b: second int | |
| """ | |
| return a % b |