Upload folder using huggingface_hub
Browse files- tools/squad_tools.py +3 -4
tools/squad_tools.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
from transformers.agents.tools import Tool
|
2 |
-
from data import
|
3 |
-
|
4 |
|
5 |
class SquadRetrieverTool(Tool):
|
6 |
name = "squad_retriever"
|
@@ -19,7 +18,7 @@ class SquadRetrieverTool(Tool):
|
|
19 |
|
20 |
def __init__(self, **kwargs):
|
21 |
super().__init__(**kwargs)
|
22 |
-
self.data =
|
23 |
self.retriever = self.data.index.as_retriever()
|
24 |
|
25 |
def forward(self, query: str) -> str:
|
@@ -52,7 +51,7 @@ class SquadQueryTool(Tool):
|
|
52 |
|
53 |
def __init__(self, **kwargs):
|
54 |
super().__init__(**kwargs)
|
55 |
-
self.data =
|
56 |
self.query_engine = self.data.index.as_query_engine()
|
57 |
|
58 |
def forward(self, query: str) -> str:
|
|
|
1 |
from transformers.agents.tools import Tool
|
2 |
+
from data import get_data
|
|
|
3 |
|
4 |
class SquadRetrieverTool(Tool):
|
5 |
name = "squad_retriever"
|
|
|
18 |
|
19 |
def __init__(self, **kwargs):
|
20 |
super().__init__(**kwargs)
|
21 |
+
self.data = get_data(download=True)
|
22 |
self.retriever = self.data.index.as_retriever()
|
23 |
|
24 |
def forward(self, query: str) -> str:
|
|
|
51 |
|
52 |
def __init__(self, **kwargs):
|
53 |
super().__init__(**kwargs)
|
54 |
+
self.data = get_data(download=True)
|
55 |
self.query_engine = self.data.index.as_query_engine()
|
56 |
|
57 |
def forward(self, query: str) -> str:
|