: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)
| 485 | DATASET_NAME: str = None |
| 486 | |
| 487 | def __init__(self, data_dir=None, cache_dir=None, download_mode=None): |
| 488 | """ |
| 489 | :param data_dir: str |
| 490 | Stores the path to a local folder containing the `Task`'s data files. |
| 491 | Use this to specify the path to manually downloaded data (usually when |
| 492 | the dataset is not publicly accessible). |
| 493 | :param cache_dir: str |
| 494 | The directory to read/write the `Task` dataset. This follows the |
| 495 | HuggingFace `datasets` API with the default cache directory located at: |
| 496 | `~/.cache/huggingface/datasets` |
| 497 | NOTE: You can change the cache location globally for a given process |
| 498 | by setting the shell environment variable, `HF_DATASETS_CACHE`, |
| 499 | to another directory: |
| 500 | `export HF_DATASETS_CACHE="/path/to/another/directory"` |
| 501 | :param download_mode: datasets.DownloadMode |
| 502 | How to treat pre-existing `Task` downloads and data. |
| 503 | - `datasets.DownloadMode.REUSE_DATASET_IF_EXISTS` |
| 504 | Reuse download and reuse dataset. |
| 505 | - `datasets.DownloadMode.REUSE_CACHE_IF_EXISTS` |
| 506 | Reuse download with fresh dataset. |
| 507 | - `datasets.DownloadMode.FORCE_REDOWNLOAD` |
| 508 | Fresh download and fresh dataset. |
| 509 | """ |
| 510 | self.download(data_dir, cache_dir, download_mode) |
| 511 | self._training_docs = None |
| 512 | self._fewshot_docs = None |
| 513 | |
| 514 | def download(self, data_dir=None, cache_dir=None, download_mode=None): |
| 515 | """Downloads and returns the task dataset. |