Spaces:
Build error
Build error
Upload tool
Browse files
tool.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
from agents import Tool
|
2 |
|
3 |
-
class HFModelDownloadsTool(Tool):
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
|
11 |
def forward(self, task: str):
|
12 |
from huggingface_hub import list_models
|
|
|
1 |
from agents import Tool
|
2 |
|
3 |
+
class HFModelDownloadsTool(Tool):
|
4 |
+
name = "model_download_counter"
|
5 |
+
description = """
|
6 |
+
This is a tool that returns the most downloaded model of a given task on the Hugging Face Hub.
|
7 |
+
It returns the name of the checkpoint."""
|
8 |
+
inputs = {"task":{"type":"string","description":"the task category (such as text-classification, depth-estimation, etc)"}}
|
9 |
+
output_type = "string"
|
10 |
|
11 |
def forward(self, task: str):
|
12 |
from huggingface_hub import list_models
|