updates
Browse files- README.md +26 -0
- process.txt +9 -4
README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
10K slice of OpenWebText - An open-source replication of the WebText dataset from OpenAI.
|
| 2 |
+
|
| 3 |
+
This is a small subset representing the first 10K records from the original dataset - created for testing.
|
| 4 |
+
|
| 5 |
+
The full 8M-record dataset is [here](https://huggingface.co/datasets/openwebtext).
|
| 6 |
+
|
| 7 |
+
```
|
| 8 |
+
$ python -c "from datasets import load_dataset; ds=load_dataset('stas/openwebtext-10k'); print(ds)"
|
| 9 |
+
DatasetDict({
|
| 10 |
+
train: Dataset({
|
| 11 |
+
features: ['text'],
|
| 12 |
+
num_rows: 10000
|
| 13 |
+
})
|
| 14 |
+
})
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
To convert to jsonlines:
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
from datasets import load_dataset
|
| 21 |
+
dataset_name = "stas/openwebtext-10k"
|
| 22 |
+
ds = load_dataset(dataset_name, split='train')
|
| 23 |
+
ds.to_json(f"{dataset_name}.jsonl", orient="records", lines=True)
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
To see how this subset was created, here is the [instructions file](./process.txt).
|
process.txt
CHANGED
|
@@ -39,7 +39,7 @@ perl -pi -e 's|https://zenodo.org/record/3834942/files/|https://cdn-datasets.hug
|
|
| 39 |
# create a new dataset entry on the hub
|
| 40 |
https://huggingface.co/new-dataset
|
| 41 |
|
| 42 |
-
# clone
|
| 43 |
git clone https://huggingface.co/datasets/stas/openwebtext-10k
|
| 44 |
cp openwebtext-10k.py process.txt openwebtext-10k
|
| 45 |
cd openwebtext-10k
|
|
@@ -48,10 +48,15 @@ git add openwebtext-10k.py process.txt
|
|
| 48 |
git commit -m "build script" openwebtext-10k.py process.txt
|
| 49 |
git push
|
| 50 |
|
| 51 |
-
#
|
| 52 |
-
|
|
|
|
| 53 |
|
| 54 |
-
# add push the generated config
|
|
|
|
| 55 |
git add dataset_infos.json
|
| 56 |
git commit -m "add dataset_infos.json" dataset_infos.json
|
| 57 |
git push
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
# create a new dataset entry on the hub
|
| 40 |
https://huggingface.co/new-dataset
|
| 41 |
|
| 42 |
+
# once created clone it
|
| 43 |
git clone https://huggingface.co/datasets/stas/openwebtext-10k
|
| 44 |
cp openwebtext-10k.py process.txt openwebtext-10k
|
| 45 |
cd openwebtext-10k
|
|
|
|
| 48 |
git commit -m "build script" openwebtext-10k.py process.txt
|
| 49 |
git push
|
| 50 |
|
| 51 |
+
# test and generate config file
|
| 52 |
+
cd ..
|
| 53 |
+
datasets-cli test ./openwebtext-10k --save_infos --all_configs
|
| 54 |
|
| 55 |
+
# add and push the generated config
|
| 56 |
+
cd openwebtext-10k
|
| 57 |
git add dataset_infos.json
|
| 58 |
git commit -m "add dataset_infos.json" dataset_infos.json
|
| 59 |
git push
|
| 60 |
+
|
| 61 |
+
# test that the dataset is working
|
| 62 |
+
python -c "from datasets import load_dataset; ds=load_dataset('stas/openwebtext-10k'); print(ds)"
|