:param data_dir: str Stores the path to a local folder containing the `Task`'s data files. Use this to specify the path to manually downloaded data (usually when the dataset is not publicly accessible). :param cache_dir: str The direct
(
self,
data_dir=None,
cache_dir=None,
download_mode=None,
config=None,
)
| 184 | OUTPUT_TYPE: str = None |
| 185 | |
| 186 | def __init__( |
| 187 | self, |
| 188 | data_dir=None, |
| 189 | cache_dir=None, |
| 190 | download_mode=None, |
| 191 | config=None, |
| 192 | ) -> None: |
| 193 | """ |
| 194 | :param data_dir: str |
| 195 | Stores the path to a local folder containing the `Task`'s data files. |
| 196 | Use this to specify the path to manually downloaded data (usually when |
| 197 | the dataset is not publicly accessible). |
| 198 | :param cache_dir: str |
| 199 | The directory to read/write the `Task` dataset. This follows the |
| 200 | HuggingFace `datasets` API with the default cache directory located at: |
| 201 | `~/.cache/huggingface/datasets` |
| 202 | NOTE: You can change the cache location globally for a given process |
| 203 | to another directory: |
| 204 | `export HF_DATASETS_CACHE="/path/to/another/directory"` |
| 205 | :param download_mode: datasets.DownloadMode |
| 206 | How to treat pre-existing `Task` downloads and data. |
| 207 | - `datasets.DownloadMode.REUSE_DATASET_IF_EXISTS` |
| 208 | Reuse download and reuse dataset. |
| 209 | - `datasets.DownloadMode.REUSE_CACHE_IF_EXISTS` |
| 210 | Reuse download with fresh dataset. |
| 211 | - `datasets.DownloadMode.FORCE_REDOWNLOAD` |
| 212 | Fresh download and fresh dataset. |
| 213 | """ |
| 214 | self.download(data_dir, cache_dir, download_mode) |
| 215 | self._training_docs = None |
| 216 | self._fewshot_docs = None |
| 217 | self._instances = None |
| 218 | |
| 219 | self._config = TaskConfig({**config}) if config else TaskConfig() |
| 220 | |
| 221 | self._filters = [build_filter_ensemble("none", [["take_first", None]])] |
| 222 | |
| 223 | def download(self, data_dir=None, cache_dir=None, download_mode=None) -> None: |
| 224 | """Downloads and returns the task dataset. |
nothing calls this directly
no test coverage detected