Datasets:
Use datasets library for loading
Browse filesUpdates the Loading example to use load_dataset.
README.md
CHANGED
|
@@ -79,24 +79,15 @@ Because `label` and parts of `metadata` have mixed JSON types, preserve them as
|
|
| 79 |
|
| 80 |
## Loading
|
| 81 |
|
| 82 |
-
|
| 83 |
|
| 84 |
```python
|
| 85 |
-
import
|
| 86 |
-
from huggingface_hub import hf_hub_download
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
filename="rl-if-math-coding-logic-60k.jsonl",
|
| 92 |
)
|
| 93 |
-
|
| 94 |
-
with open(path, encoding="utf-8") as file:
|
| 95 |
-
for line in file:
|
| 96 |
-
example = json.loads(line)
|
| 97 |
-
prompt = example["prompt"]
|
| 98 |
-
label = example["label"]
|
| 99 |
-
metadata = example["metadata"]
|
| 100 |
```
|
| 101 |
|
| 102 |
Users who require `datasets.Dataset` should first normalize heterogeneous JSON fields or define an explicit schema appropriate for their training stack.
|
|
|
|
| 79 |
|
| 80 |
## Loading
|
| 81 |
|
| 82 |
+
Load the dataset with the Hugging Face `datasets` library:
|
| 83 |
|
| 84 |
```python
|
| 85 |
+
from datasets import load_dataset
|
|
|
|
| 86 |
|
| 87 |
+
dataset = load_dataset(
|
| 88 |
+
"wflying/rl-if-math-coding-logic-60k",
|
| 89 |
+
split="train",
|
|
|
|
| 90 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
```
|
| 92 |
|
| 93 |
Users who require `datasets.Dataset` should first normalize heterogeneous JSON fields or define an explicit schema appropriate for their training stack.
|