| 6 | |
| 7 | |
| 8 | class ToolFillDataset(ToolDataset): |
| 9 | def __init__(self, dataset_name, tool_task, filepath): |
| 10 | self.dataset_name = dataset_name |
| 11 | self.tool_task = tool_task |
| 12 | self.filepath = filepath |
| 13 | self.datas = self.load_data() |
| 14 | |
| 15 | def load_data(self, ) -> list: |
| 16 | if self.filepath: |
| 17 | return self.load_data_from_local(self.filepath) |
| 18 | elif self.dataset_name and self.tool_task: |
| 19 | return self.load_data_from_hf(self.tool_task) |
| 20 | return [] |
| 21 | |
| 22 | def load_data_from_local(self, filepath): |
| 23 | if "jsonl" in filepath: |
| 24 | return read_jsonl_file(filepath) |
| 25 | elif "json" in filepath: |
| 26 | return read_json_file(filepath) |
| 27 | return [] |
| 28 | |
| 29 | def load_data_from_hf(self, tool_task): |
| 30 | pass |
nothing calls this directly
no outgoing calls
no test coverage detected