xvjiarui commited on
Commit
0e3b720
·
1 Parent(s): 5ed0c1a

add dataset

Browse files
SHA256SUMS.txt ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 15202e860ccd6311a3ab862958a59df9a9c16200205e7897d956007546aa5c38 ./train/00.jsonl.zst
2
+ 907f1dc9d5d10637943411b634da776be20b9a0b243cb68df35529c42b8e4b12 ./train/01.jsonl.zst
3
+ 08268e67aca7744a4d731b88432d7efb51f3b62329abda1fc3621f9454956d31 ./train/02.jsonl.zst
4
+ 5dd899329852f74e4d726793e8258fca55a295a888d00420f96eac56a6a7853f ./train/03.jsonl.zst
5
+ e3e874c1a985977e321d38effeb8ef17974d6f97765c6ee68890511244762654 ./train/04.jsonl.zst
6
+ 87983f2e1ea64f76ff39509f9fb049cb75c16d9463eebbb3b8c55dd3bbdaceab ./train/05.jsonl.zst
7
+ 4d7e3342dee440d3b48e3d2a63e4128f234963e709bfeee54ff0fd9fadd4f495 ./train/06.jsonl.zst
8
+ f9c5dd18007860dc64d970215d1a195aea8f9442c059aeb2d8200f1734bdd45b ./train/07.jsonl.zst
9
+ 535c2b94560a4ef9e186f136bda236def014b14c38aab24ffbfc8fda4462099b ./train/08.jsonl.zst
10
+ 81673724c2991b6ab884c763bacd4d398fcb53d1ee6bc6873533c7ce54fddef5 ./train/09.jsonl.zst
11
+ ead60faf3327b90e6220b085aea4a329309187ef0d5338cc4d830a01a624cc32 ./train/10.jsonl.zst
12
+ 0620e4e3389481d0ee924ad907d97164aa6cbc86c21c79545c38a43af5b1f2a8 ./train/11.jsonl.zst
13
+ 1603fe64a34a94bca984d1b7d3c4747114a5ef74d93cb1236673afe32bab8650 ./train/12.jsonl.zst
14
+ 0addedc5ffcba599684e3003266c96ce3a83f3883eb086034151ed638cbf90b0 ./train/13.jsonl.zst
15
+ 33a83ed9f6dd9ef684fe8a43dfa9d0095e4c18dc59551be5caf609c6d40f8dce ./train/14.jsonl.zst
16
+ 761e59aa85d51fc6869edea019c4cb85aa546d6a26dcf67df7cdbd0fcfa30a7d ./train/15.jsonl.zst
17
+ dff936fe96b25eaa049ac5b0215fc441730bb5b4c30aff3281521cd322201fd0 ./train/16.jsonl.zst
18
+ 41c092901b399739df04d1f3fbcd4ba6ef3692d48ca4f4eb1281bbe74b3f33e5 ./train/17.jsonl.zst
19
+ b3566f866b467bf134dbddbb490d895560fe32d7ecc681a3ab6ec6777183f293 ./train/18.jsonl.zst
20
+ 393ceb7f53eabe4d579470164093807a1dfeb925b90c052ac7fc4d9e1d64a1da ./train/19.jsonl.zst
21
+ 8b9b849aacbf27110e625f6fe8c835bd6d807b458750de7b44721ee9d3b12332 ./train/20.jsonl.zst
22
+ 4f1b936435209cb57ad5de1c255588082d19481bc65fb61c647861f0135bfe8e ./train/21.jsonl.zst
23
+ af0ee9bf2d1f4b7308fc6fff42c69d8d3a989853bfdfb2eaf057f00ffbce1796 ./train/22.jsonl.zst
24
+ aac743419feffe4b78cd9e39f30b0efd9b31d6d05dbc6e78af53171111438493 ./train/23.jsonl.zst
25
+ 7c0ab53491f7e4fe43838c00030da10a6818404bbec7d605250fecc64bb48b70 ./train/24.jsonl.zst
26
+ 22667ee84a85558f1adb0e4eb00c8a4447769944df2ea7258f38581e3e323fb9 ./train/25.jsonl.zst
27
+ ba4e71ec600387819640c4739b7fa938779f6c66d16c2fb82b5d7903ecf1919f ./train/26.jsonl.zst
28
+ e2f3ca67e218217bbc8b73b19efe28e1b908f878eb32dd17398653e047ae2221 ./train/27.jsonl.zst
29
+ 2b56a18e56103d1352779861f5c2778c58e1bad231b6fd66091ee1a04d73affb ./train/28.jsonl.zst
30
+ 8b94cc8dbaa4406dfb276ae775bdb78da5388a9b3cca18b9a2fc85d3419037fd ./train/29.jsonl.zst
31
+ 0bb28c52d0b5596d389bf179ce2d43bf7f7ffae76b0d2d20b180c97f62e0975e ./test.jsonl.zst
32
+ 264c875d8bbd355d8daa9d032b75fd8fb91606218bb84dd1155b203fcd5fab92 ./val.jsonl.zst
33
+
pile.py ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ """The Pile dataset."""
16
+
17
+ import json
18
+
19
+ import datasets
20
+
21
+
22
+ _CITATION = """\
23
+ @misc{gao2020pile,
24
+ title={The Pile: An 800GB Dataset of Diverse Text for Language Modeling},
25
+ author={Leo Gao and Stella Biderman and Sid Black and Laurence Golding and Travis Hoppe and Charles Foster and Jason Phang and Horace He and Anish Thite and Noa Nabeshima and Shawn Presser and Connor Leahy},
26
+ year={2020},
27
+ eprint={2101.00027},
28
+ archivePrefix={arXiv},
29
+ primaryClass={cs.CL}
30
+ }
31
+ """
32
+
33
+ _DESCRIPTION = """\
34
+ The Pile is a 825 GiB diverse, open source language modelling data set that consists of 22 smaller, high-quality
35
+ datasets combined together.
36
+ """
37
+
38
+ _HOMEPAGE = "https://pile.eleuther.ai/"
39
+
40
+ _LICENSES = {
41
+ "all": "Multiple: see each subset license",
42
+ }
43
+
44
+ _HOST_URL = "/persistent/PILE_zip"
45
+ _DATA_URLS = {
46
+ "all": {
47
+ "train": [f"{_HOST_URL}/train/{i:0>2}.jsonl.zst" for i in range(30)],
48
+ "validation": [f"{_HOST_URL}/val.jsonl.zst"],
49
+ "test": [f"{_HOST_URL}/test.jsonl.zst"],
50
+ },
51
+ }
52
+
53
+ _FEATURES = {
54
+ "all": datasets.Features(
55
+ {
56
+ "text": datasets.Value("string"),
57
+ "meta": {"pile_set_name": datasets.Value("string")},
58
+ }
59
+ ),
60
+ }
61
+
62
+
63
+ class ThePileConfig(datasets.BuilderConfig):
64
+ """BuilderConfig for The Pile."""
65
+
66
+ def __init__(self, *args, subsets, **kwargs):
67
+ """BuilderConfig for The Pile.
68
+
69
+ Args:
70
+ subsets (:obj:`List[str]`): List of subsets to load.
71
+ **kwargs: keyword arguments forwarded to super.
72
+ """
73
+ super().__init__(
74
+ *args,
75
+ name="+".join(subsets),
76
+ **kwargs,
77
+ )
78
+ self.subsets = subsets
79
+
80
+
81
+ class ThePile(datasets.GeneratorBasedBuilder):
82
+ """The Pile dataset."""
83
+
84
+ VERSION = datasets.Version("1.1.0")
85
+
86
+ BUILDER_CONFIG_CLASS = ThePileConfig
87
+ BUILDER_CONFIGS = [ThePileConfig(subsets=[subset]) for subset in _DATA_URLS]
88
+ DEFAULT_CONFIG_NAME = "all"
89
+
90
+ def _info(self):
91
+ """Give information and typings for the dataset."""
92
+ return datasets.DatasetInfo(
93
+ # This is the description that will appear on the datasets page.
94
+ description=_DESCRIPTION,
95
+ # This defines the different columns of the dataset and their types
96
+ features=_FEATURES.get(self.config.name),
97
+ # If there's a common (input, target) tuple from the features,
98
+ # specify them here. They'll be used if as_supervised=True in
99
+ # builder.as_dataset.
100
+ supervised_keys=None,
101
+ # Homepage of the dataset for documentation
102
+ homepage=_HOMEPAGE,
103
+ # License for the dataset if available
104
+ license=_LICENSES.get(self.config.name, "Multiple: see each subset license"),
105
+ # Citation for the dataset
106
+ citation=_CITATION,
107
+ )
108
+
109
+ def _split_generators(self, dl_manager):
110
+ """Return SplitGenerators."""
111
+ assert self.config.name == "all"
112
+ data_dir = dl_manager.download(_DATA_URLS[self.config.name])
113
+ return [
114
+ datasets.SplitGenerator(
115
+ name=split,
116
+ gen_kwargs={
117
+ "files": data_dir[split],
118
+ },
119
+ )
120
+ for split in [datasets.Split.TRAIN, datasets.Split.VALIDATION, datasets.Split.TEST]
121
+ ]
122
+
123
+ def _generate_examples(self, files):
124
+ """Yield examples as (key, example) tuples."""
125
+ key = 0
126
+ assert isinstance(files, list)
127
+ import zstandard as zstd
128
+
129
+ for path in files:
130
+ with zstd.open(open(path, "rb"), "rt", encoding="utf-8") as f:
131
+ for row in f:
132
+ data = json.loads(row)
133
+ yield key, data
134
+ key += 1
test.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0bb28c52d0b5596d389bf179ce2d43bf7f7ffae76b0d2d20b180c97f62e0975e
3
+ size 460250856
train/00.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15202e860ccd6311a3ab862958a59df9a9c16200205e7897d956007546aa5c38
3
+ size 15240542576
train/01.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:907f1dc9d5d10637943411b634da776be20b9a0b243cb68df35529c42b8e4b12
3
+ size 15213826121
train/02.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08268e67aca7744a4d731b88432d7efb51f3b62329abda1fc3621f9454956d31
3
+ size 15206478430
train/03.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5dd899329852f74e4d726793e8258fca55a295a888d00420f96eac56a6a7853f
3
+ size 15192808107
train/04.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3e874c1a985977e321d38effeb8ef17974d6f97765c6ee68890511244762654
3
+ size 15185851603
train/05.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87983f2e1ea64f76ff39509f9fb049cb75c16d9463eebbb3b8c55dd3bbdaceab
3
+ size 15212827627
train/06.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d7e3342dee440d3b48e3d2a63e4128f234963e709bfeee54ff0fd9fadd4f495
3
+ size 15256748981
train/07.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9c5dd18007860dc64d970215d1a195aea8f9442c059aeb2d8200f1734bdd45b
3
+ size 15309606649
train/08.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:535c2b94560a4ef9e186f136bda236def014b14c38aab24ffbfc8fda4462099b
3
+ size 15230393244
train/09.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81673724c2991b6ab884c763bacd4d398fcb53d1ee6bc6873533c7ce54fddef5
3
+ size 15224032048
train/10.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ead60faf3327b90e6220b085aea4a329309187ef0d5338cc4d830a01a624cc32
3
+ size 15228149551
train/11.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0620e4e3389481d0ee924ad907d97164aa6cbc86c21c79545c38a43af5b1f2a8
3
+ size 15224461477
train/12.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1603fe64a34a94bca984d1b7d3c4747114a5ef74d93cb1236673afe32bab8650
3
+ size 15260161127
train/13.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0addedc5ffcba599684e3003266c96ce3a83f3883eb086034151ed638cbf90b0
3
+ size 15208246978
train/14.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33a83ed9f6dd9ef684fe8a43dfa9d0095e4c18dc59551be5caf609c6d40f8dce
3
+ size 15217956455
train/15.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:761e59aa85d51fc6869edea019c4cb85aa546d6a26dcf67df7cdbd0fcfa30a7d
3
+ size 15276796998
train/16.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dff936fe96b25eaa049ac5b0215fc441730bb5b4c30aff3281521cd322201fd0
3
+ size 15273744623
train/17.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41c092901b399739df04d1f3fbcd4ba6ef3692d48ca4f4eb1281bbe74b3f33e5
3
+ size 15313655872
train/18.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3566f866b467bf134dbddbb490d895560fe32d7ecc681a3ab6ec6777183f293
3
+ size 15308582674
train/19.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:393ceb7f53eabe4d579470164093807a1dfeb925b90c052ac7fc4d9e1d64a1da
3
+ size 15279096441
train/20.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b9b849aacbf27110e625f6fe8c835bd6d807b458750de7b44721ee9d3b12332
3
+ size 15209947917
train/21.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f1b936435209cb57ad5de1c255588082d19481bc65fb61c647861f0135bfe8e
3
+ size 15311248597
train/22.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af0ee9bf2d1f4b7308fc6fff42c69d8d3a989853bfdfb2eaf057f00ffbce1796
3
+ size 15299690537
train/23.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aac743419feffe4b78cd9e39f30b0efd9b31d6d05dbc6e78af53171111438493
3
+ size 15293953191
train/24.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c0ab53491f7e4fe43838c00030da10a6818404bbec7d605250fecc64bb48b70
3
+ size 15193934462
train/25.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22667ee84a85558f1adb0e4eb00c8a4447769944df2ea7258f38581e3e323fb9
3
+ size 15198629367
train/26.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba4e71ec600387819640c4739b7fa938779f6c66d16c2fb82b5d7903ecf1919f
3
+ size 15200998151
train/27.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2f3ca67e218217bbc8b73b19efe28e1b908f878eb32dd17398653e047ae2221
3
+ size 15216321939
train/28.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b56a18e56103d1352779861f5c2778c58e1bad231b6fd66091ee1a04d73affb
3
+ size 15219852363
train/29.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b94cc8dbaa4406dfb276ae775bdb78da5388a9b3cca18b9a2fc85d3419037fd
3
+ size 15218355549
val.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:264c875d8bbd355d8daa9d032b75fd8fb91606218bb84dd1155b203fcd5fab92
3
+ size 470907480