Update README.md
Browse files
README.md
CHANGED
|
@@ -1,27 +1,84 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
configs:
|
| 4 |
-
- config_name: default
|
| 5 |
-
data_files:
|
| 6 |
-
- split: train
|
| 7 |
-
path: data/train-*
|
| 8 |
-
- split: test
|
| 9 |
-
path: data/test-*
|
| 10 |
-
dataset_info:
|
| 11 |
-
features:
|
| 12 |
-
- name: images
|
| 13 |
-
sequence: string
|
| 14 |
-
- name: problem
|
| 15 |
-
dtype: string
|
| 16 |
-
- name: answer
|
| 17 |
-
dtype: string
|
| 18 |
-
splits:
|
| 19 |
-
- name: train
|
| 20 |
-
num_bytes: 477238
|
| 21 |
-
num_examples: 3000
|
| 22 |
-
- name: test
|
| 23 |
-
num_bytes: 93920
|
| 24 |
-
num_examples: 600
|
| 25 |
-
download_size: 287256
|
| 26 |
-
dataset_size: 571158
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
configs:
|
| 4 |
+
- config_name: default
|
| 5 |
+
data_files:
|
| 6 |
+
- split: train
|
| 7 |
+
path: data/train-*
|
| 8 |
+
- split: test
|
| 9 |
+
path: data/test-*
|
| 10 |
+
dataset_info:
|
| 11 |
+
features:
|
| 12 |
+
- name: images
|
| 13 |
+
sequence: string
|
| 14 |
+
- name: problem
|
| 15 |
+
dtype: string
|
| 16 |
+
- name: answer
|
| 17 |
+
dtype: string
|
| 18 |
+
splits:
|
| 19 |
+
- name: train
|
| 20 |
+
num_bytes: 477238
|
| 21 |
+
num_examples: 3000
|
| 22 |
+
- name: test
|
| 23 |
+
num_bytes: 93920
|
| 24 |
+
num_examples: 600
|
| 25 |
+
download_size: 287256
|
| 26 |
+
dataset_size: 571158
|
| 27 |
+
language:
|
| 28 |
+
- en
|
| 29 |
+
size_categories:
|
| 30 |
+
- 1K<n<10K
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
Please download [images.tar](images.tar) to your local disk and use `tar -xvf images.tar` to unarchive the image files.
|
| 34 |
+
|
| 35 |
+
This dataset was mixed with [hiyouga/geometry3k](https://huggingface.co/datasets/hiyouga/geometry3k) and [hiyouga/math12k](https://huggingface.co/datasets/hiyouga/math12k) using the following script.
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
import os
|
| 39 |
+
from functools import partial
|
| 40 |
+
|
| 41 |
+
from datasets import DatasetDict, Features, Sequence, Value, concatenate_datasets, load_dataset
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def process_sample(example: dict, index: int, split: str):
|
| 45 |
+
if "images" in example:
|
| 46 |
+
image = example["images"][0]
|
| 47 |
+
image_path = os.path.join("images", split, f"{index}.png")
|
| 48 |
+
image.save(image_path)
|
| 49 |
+
images = [image_path]
|
| 50 |
+
else:
|
| 51 |
+
images = []
|
| 52 |
+
|
| 53 |
+
return {
|
| 54 |
+
"images": images,
|
| 55 |
+
"problem": example["problem"],
|
| 56 |
+
"answer": example["answer"],
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def main():
|
| 61 |
+
geo3k = load_dataset("hiyouga/geometry3k")
|
| 62 |
+
math12k = load_dataset("hiyouga/math12k")
|
| 63 |
+
os.makedirs(os.path.join("images", "train"), exist_ok=True)
|
| 64 |
+
os.makedirs(os.path.join("images", "test"), exist_ok=True)
|
| 65 |
+
map_kwargs = {
|
| 66 |
+
"with_indices": True,
|
| 67 |
+
"num_proc": 64,
|
| 68 |
+
"features": Features(
|
| 69 |
+
{"images": Sequence(Value("string")), "problem": Value("string"), "answer": Value("string")}
|
| 70 |
+
),
|
| 71 |
+
}
|
| 72 |
+
geo3k_train = geo3k["train"].select(range(1500)).map(partial(process_sample, split="train"), **map_kwargs)
|
| 73 |
+
geo3k_test = geo3k["test"].select(range(300)).map(partial(process_sample, split="test"), **map_kwargs)
|
| 74 |
+
math12k_train = math12k["train"].select(range(1500)).map(partial(process_sample, split="train"), **map_kwargs)
|
| 75 |
+
math12k_test = math12k["test"].select(range(300)).map(partial(process_sample, split="test"), **map_kwargs)
|
| 76 |
+
trainset = concatenate_datasets([geo3k_train, math12k_train])
|
| 77 |
+
testset = concatenate_datasets([geo3k_test, math12k_test])
|
| 78 |
+
dataset = DatasetDict({"train": trainset, "test": testset})
|
| 79 |
+
dataset.push_to_hub("hiyouga/rl-mixed-dataset")
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
if __name__ == "__main__":
|
| 83 |
+
main()
|
| 84 |
+
```
|