Datasets:
Upload 12 files
Browse files- .gitattributes +2 -0
- RedPajama-Data-1204Sample.py +107 -0
- arxiv_sample.jsonl +3 -0
- book_sample.jsonl +3 -0
- c4_sample.jsonl +0 -0
- cc_2019-30_sample.jsonl +0 -0
- cc_2020-05_sample.jsonl +0 -0
- cc_2021-04_sample.jsonl +0 -0
- cc_2022-05_sample.jsonl +0 -0
- cc_2023-06_sample.jsonl +0 -0
- github_sample.jsonl +0 -0
- stackexchange_sample.jsonl +0 -0
- wikipedia_sample.jsonl +0 -0
.gitattributes
CHANGED
|
@@ -53,3 +53,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
arxiv_sample.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
book_sample.jsonl filter=lfs diff=lfs merge=lfs -text
|
RedPajama-Data-1204Sample.py
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2023 Together Computer
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
|
| 15 |
+
# Lint as: python3
|
| 16 |
+
"""RedPajama: An Open-Source, Clean-Room 1.2 Trillion Token Dataset."""
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
import json
|
| 20 |
+
|
| 21 |
+
import datasets
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
logger = datasets.logging.get_logger(__name__)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
_DESCRIPTION = """\
|
| 28 |
+
RedPajama is a clean-room, fully open-source implementation of the LLaMa dataset. This is a 1B-token sample of the full dataset.
|
| 29 |
+
"""
|
| 30 |
+
|
| 31 |
+
_URLS = [
|
| 32 |
+
"arxiv_sample.jsonl",
|
| 33 |
+
"book_sample.jsonl",
|
| 34 |
+
"c4_sample.jsonl",
|
| 35 |
+
"cc_2019-30_sample.jsonl",
|
| 36 |
+
"cc_2020-05_sample.jsonl",
|
| 37 |
+
"cc_2021-04_sample.jsonl",
|
| 38 |
+
"cc_2022-05_sample.jsonl",
|
| 39 |
+
"cc_2023-06_sample.jsonl",
|
| 40 |
+
"github_sample.jsonl",
|
| 41 |
+
"stackexchange_sample.jsonl",
|
| 42 |
+
"wikipedia_sample.jsonl",
|
| 43 |
+
]
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
class RedPajama1TSampleConfig(datasets.BuilderConfig):
|
| 47 |
+
"""BuilderConfig for RedPajama sample."""
|
| 48 |
+
|
| 49 |
+
def __init__(self, **kwargs):
|
| 50 |
+
"""BuilderConfig for RedPajama sample.
|
| 51 |
+
Args:
|
| 52 |
+
**kwargs: keyword arguments forwarded to super.
|
| 53 |
+
"""
|
| 54 |
+
super(RedPajama1TSampleConfig, self).__init__(**kwargs)
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
class RedPajama1TSample(datasets.GeneratorBasedBuilder):
|
| 58 |
+
"""RedPajama 1T Sample: version 1.0.0."""
|
| 59 |
+
|
| 60 |
+
BUILDER_CONFIGS = [
|
| 61 |
+
RedPajama1TSampleConfig(
|
| 62 |
+
name="plain_text",
|
| 63 |
+
version=datasets.Version("1.0.0", ""),
|
| 64 |
+
description="Plain text",
|
| 65 |
+
),
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
def _info(self):
|
| 69 |
+
return datasets.DatasetInfo(
|
| 70 |
+
description=_DESCRIPTION,
|
| 71 |
+
features=datasets.Features(
|
| 72 |
+
{
|
| 73 |
+
"text": datasets.Value("string"),
|
| 74 |
+
"meta": datasets.Value("string"),
|
| 75 |
+
}
|
| 76 |
+
),
|
| 77 |
+
supervised_keys=None,
|
| 78 |
+
)
|
| 79 |
+
|
| 80 |
+
def _split_generators(self, dl_manager):
|
| 81 |
+
downloaded_files = dl_manager.download_and_extract(_URLS)
|
| 82 |
+
|
| 83 |
+
return [
|
| 84 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": downloaded_files})
|
| 85 |
+
]
|
| 86 |
+
|
| 87 |
+
def _generate_examples(self, filepaths):
|
| 88 |
+
"""This function returns the examples in the raw (text) form."""
|
| 89 |
+
logger.info("generating examples from = %s", filepaths)
|
| 90 |
+
key = 0
|
| 91 |
+
for filepath in filepaths:
|
| 92 |
+
with open(filepath, encoding="utf-8") as f:
|
| 93 |
+
for row in f:
|
| 94 |
+
data = json.loads(row)
|
| 95 |
+
if "meta" not in data:
|
| 96 |
+
text = data["text"]
|
| 97 |
+
del data["text"]
|
| 98 |
+
yield key, {
|
| 99 |
+
"text": text,
|
| 100 |
+
"meta": json.dumps(data),
|
| 101 |
+
}
|
| 102 |
+
else:
|
| 103 |
+
yield key, {
|
| 104 |
+
"text": data["text"],
|
| 105 |
+
"meta": data["meta"],
|
| 106 |
+
}
|
| 107 |
+
key += 1
|
arxiv_sample.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9e3aabc1002a27fa400db60a78faf135f1e93b5e825c3860dec2ac74d7d4449
|
| 3 |
+
size 64028001
|
book_sample.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:755329b74f6b550095e8e5bf6d181c4ef58cac77cc1d9720e65c68d9b4da47a3
|
| 3 |
+
size 110562853
|
c4_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
cc_2019-30_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
cc_2020-05_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
cc_2021-04_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
cc_2022-05_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
cc_2023-06_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
github_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
stackexchange_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
wikipedia_sample.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|