Download src/tools/__init__.py from VLAI-AIVN/AIO2024M10_Tutorial_Tool_Calling: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/VLAI-AIVN/AIO2024M10_Tutorial_Tool_Calling/resolve/main/src/tools/__init__.py
- Command line
-
hf download hf://spaces/VLAI-AIVN/AIO2024M10_Tutorial_Tool_Calling/src/tools/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/VLAI-AIVN/AIO2024M10_Tutorial_Tool_Calling/resolve/main/src/tools/__init__.py
1.23 kB
| from .detection_model import run_detection | |
| from .segmentation_model import run_segmentation | |
| __all__ = ["run_detection", "run_segmentation"] | |
| FUNCTION_SCHEMA = [ | |
| { | |
| "type": "function", | |
| "function": { | |
| "name": "run_detection", | |
| "description": "Detect objects in an image and return bounding boxes and labels.", | |
| "parameters": { | |
| "type": "object", | |
| "properties": { | |
| "image_path": {"type": "string", "description": "Local path to the image file."}, | |
| "is_visualize":{"type": "bool", "description": "If true draw bboxes and save next to image."} | |
| }, | |
| "required": ["image_path"] | |
| }, | |
| }, | |
| }, | |
| { | |
| "type": "function", | |
| "function": { | |
| "name": "run_segmentation", | |
| "description": "Segment objects in an image and return binary masks.", | |
| "parameters": { | |
| "type": "object", | |
| "properties": { | |
| "image_path": {"type": "string", "description": "Local path to the image file."} | |
| }, | |
| "required": ["image_path"] | |
| }, | |
| }, | |
| }, | |
| ] | |