Update testb.py
Browse files
testb.py
CHANGED
@@ -16,11 +16,11 @@ class TestB(datasets.GeneratorBasedBuilder):
|
|
16 |
BUILDER_CONFIGS = [
|
17 |
TestBConfig(
|
18 |
name="data1",
|
19 |
-
data_url="data1
|
20 |
),
|
21 |
TestBConfig(
|
22 |
name="data2",
|
23 |
-
data_url="data2
|
24 |
)]
|
25 |
|
26 |
def _info(self):
|
@@ -29,15 +29,15 @@ class TestB(datasets.GeneratorBasedBuilder):
|
|
29 |
description='desc'
|
30 |
)
|
31 |
def _split_generators(self, dl_manager):
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
return [
|
37 |
datasets.SplitGenerator(
|
38 |
name=datasets.Split.TRAIN,
|
39 |
gen_kwargs={
|
40 |
-
"data_file": os.path.join(
|
41 |
"split": datasets.Split.TRAIN,
|
42 |
},
|
43 |
)
|
|
|
16 |
BUILDER_CONFIGS = [
|
17 |
TestBConfig(
|
18 |
name="data1",
|
19 |
+
data_url="data1",
|
20 |
),
|
21 |
TestBConfig(
|
22 |
name="data2",
|
23 |
+
data_url="data2",
|
24 |
)]
|
25 |
|
26 |
def _info(self):
|
|
|
29 |
description='desc'
|
30 |
)
|
31 |
def _split_generators(self, dl_manager):
|
32 |
+
dl_dir = dl_manager.download_and_extract(self.config.data_url+'/test.json') or ""
|
33 |
+
task_name = _get_task_name_from_data_url(self.config.data_url)
|
34 |
+
dl_dir = os.path.join(dl_dir, task_name)
|
35 |
+
print('dl_dir',dl_dir)
|
36 |
return [
|
37 |
datasets.SplitGenerator(
|
38 |
name=datasets.Split.TRAIN,
|
39 |
gen_kwargs={
|
40 |
+
"data_file": os.path.join(dl_dir "test.json"),
|
41 |
"split": datasets.Split.TRAIN,
|
42 |
},
|
43 |
)
|