Commit
·
f2886d8
1
Parent(s):
ae16501
Update winogavil.py
Browse files- winogavil.py +5 -13
winogavil.py
CHANGED
@@ -96,21 +96,13 @@ class Winogavil(datasets.GeneratorBasedBuilder):
|
|
96 |
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
97 |
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
98 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
name=datasets.Split.TEST,
|
104 |
-
# These kwargs will be passed to _generate_examples
|
105 |
-
gen_kwargs={
|
106 |
-
"filepath": os.path.join(data_dir, "winogavil_dataset.csv"),
|
107 |
-
"split": "test",
|
108 |
-
},
|
109 |
-
)
|
110 |
-
]
|
111 |
|
112 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
113 |
-
def _generate_examples(self,
|
114 |
print('winogavil.py _generate_examples')
|
115 |
|
116 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
|
|
96 |
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
97 |
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
98 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
99 |
+
data_dir = dl_manager.download_and_extract({
|
100 |
+
"examples_csv": hf_hub_url("datasets/nlphuji/winogavil", filename="winogavil_dataset.csv")})
|
101 |
+
|
102 |
+
return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs=downloaded_files)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
105 |
+
def _generate_examples(self, examples_csv):
|
106 |
print('winogavil.py _generate_examples')
|
107 |
|
108 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|