@@ -86,20 +86,20 @@ Let's create a python file in the directory where we're writing our YAML file:
...
@@ -86,20 +86,20 @@ Let's create a python file in the directory where we're writing our YAML file:
```bash
```bash
touch lm_eval/tasks/<dataset_name>/utils.py
touch lm_eval/tasks/<dataset_name>/utils.py
```
```
Now, in `utils.py` we'll write a function to process each split of our dataset:
Now, in `utils.py` we'll write a function to process each split of our dataset (the following example is drawn from [the `hellaswag` task](../lm_eval/tasks/hellaswag/utils.py)):
TODO: Change the example to one that's in the tasks/
returndataset.map(_helper)# returns back a datasets.Dataset object
returnout_doc
returndataset.map(_process_doc)
```
```
Now, in our YAML config file we'll use the `!function` constructor, and tell the config where our imported Python function will come from. At runtime, before doing anything else we will preprocess our dataset according to this function!
Now, in our YAML config file we'll use the `!function` constructor, and tell the config where our imported Python function will come from. At runtime, before doing anything else we will preprocess our dataset according to this function!