jordiclive
commited on
Commit
•
8acf52d
1
Parent(s):
59131df
Update uspto2.py
Browse files
uspto2.py
CHANGED
@@ -26,37 +26,38 @@ class PileDomainDataset(GeneratorBasedBuilder):
|
|
26 |
|
27 |
def _split_generators(self, dl_manager):
|
28 |
#snapshot_download(repo_id="Multi-Domain-Expert-Layers/uspto", repo_type="dataset")
|
29 |
-
|
|
|
30 |
|
31 |
return [
|
32 |
datasets.SplitGenerator(
|
33 |
name=datasets.Split.TRAIN,
|
34 |
gen_kwargs={
|
35 |
-
"data_dir": "data/train",
|
36 |
"split": None,
|
37 |
},
|
38 |
),
|
39 |
datasets.SplitGenerator(
|
40 |
name="validation_pile",
|
41 |
gen_kwargs={
|
42 |
-
"data_dir": "data/val",
|
43 |
"split": "pile",
|
44 |
},
|
45 |
),
|
46 |
datasets.SplitGenerator(
|
47 |
name="validation_domain",
|
48 |
gen_kwargs={
|
49 |
-
"data_dir": "data/val",
|
50 |
"split": "domain",
|
51 |
},
|
52 |
),
|
53 |
datasets.SplitGenerator(
|
54 |
name="test_pile",
|
55 |
-
gen_kwargs={"data_dir": "data/test", "split": "pile"},
|
56 |
),
|
57 |
datasets.SplitGenerator(
|
58 |
name="test_domain",
|
59 |
-
gen_kwargs={"data_dir": "data/test", "split": "domain"},
|
60 |
),
|
61 |
]
|
62 |
|
@@ -74,4 +75,3 @@ class PileDomainDataset(GeneratorBasedBuilder):
|
|
74 |
data = json.loads(line)
|
75 |
idx += 1
|
76 |
yield idx, data
|
77 |
-
|
|
|
26 |
|
27 |
def _split_generators(self, dl_manager):
|
28 |
#snapshot_download(repo_id="Multi-Domain-Expert-Layers/uspto", repo_type="dataset")
|
29 |
+
# dl_manager.download_and_extract("https://huggingface.co/datasets/Multi-Domain-Expert-Layers/uspto/resolve/main/uspto.tar.gz")
|
30 |
+
dl_path = snapshot_download(repo_id="jordiclive/my_uspto2", repo_type="dataset")
|
31 |
|
32 |
return [
|
33 |
datasets.SplitGenerator(
|
34 |
name=datasets.Split.TRAIN,
|
35 |
gen_kwargs={
|
36 |
+
"data_dir": os.path.join(dl_path, "data/train"),
|
37 |
"split": None,
|
38 |
},
|
39 |
),
|
40 |
datasets.SplitGenerator(
|
41 |
name="validation_pile",
|
42 |
gen_kwargs={
|
43 |
+
"data_dir": os.path.join(dl_path, "data/val"),
|
44 |
"split": "pile",
|
45 |
},
|
46 |
),
|
47 |
datasets.SplitGenerator(
|
48 |
name="validation_domain",
|
49 |
gen_kwargs={
|
50 |
+
"data_dir": os.path.join(dl_path, "data/val"),
|
51 |
"split": "domain",
|
52 |
},
|
53 |
),
|
54 |
datasets.SplitGenerator(
|
55 |
name="test_pile",
|
56 |
+
gen_kwargs={"data_dir": os.path.join(dl_path, "data/test"), "split": "pile"},
|
57 |
),
|
58 |
datasets.SplitGenerator(
|
59 |
name="test_domain",
|
60 |
+
gen_kwargs={"data_dir": os.path.join(dl_path, "data/test"), "split": "domain"},
|
61 |
),
|
62 |
]
|
63 |
|
|
|
75 |
data = json.loads(line)
|
76 |
idx += 1
|
77 |
yield idx, data
|
|