Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -71,7 +71,7 @@ Load the full dataset:
|
|
| 71 |
```python
|
| 72 |
from datasets import load_dataset
|
| 73 |
|
| 74 |
-
ds = load_dataset("cadd-instruct") # default "all" config
|
| 75 |
print(ds["train"][0])
|
| 76 |
```
|
| 77 |
|
|
@@ -80,7 +80,7 @@ Filter the combined dataset by `source`:
|
|
| 80 |
```python
|
| 81 |
from datasets import load_dataset
|
| 82 |
|
| 83 |
-
ds = load_dataset("cadd-instruct", split="train")
|
| 84 |
smiley = ds.filter(lambda ex: ex["source"] == "smileyllama")
|
| 85 |
```
|
| 86 |
|
|
@@ -89,8 +89,8 @@ Or load a specific source directly:
|
|
| 89 |
```python
|
| 90 |
from datasets import load_dataset
|
| 91 |
|
| 92 |
-
smiley = load_dataset("cadd-instruct", "smileyllama")
|
| 93 |
-
link = load_dataset("cadd-instruct", "linkllama")
|
| 94 |
```
|
| 95 |
|
| 96 |
Stream instead of downloading everything up front:
|
|
@@ -98,7 +98,7 @@ Stream instead of downloading everything up front:
|
|
| 98 |
```python
|
| 99 |
from datasets import load_dataset
|
| 100 |
|
| 101 |
-
ds = load_dataset("cadd-instruct", split="train", streaming=True)
|
| 102 |
for example in ds:
|
| 103 |
print(example["input"], "->", example["output"])
|
| 104 |
break
|
|
@@ -109,7 +109,7 @@ Format a row into a prompt for supervised fine-tuning:
|
|
| 109 |
```python
|
| 110 |
from datasets import load_dataset
|
| 111 |
|
| 112 |
-
ds = load_dataset("cadd-instruct", split="train")
|
| 113 |
|
| 114 |
def to_prompt(ex):
|
| 115 |
return {"text": f"{ex['instruction']}\n\n{ex['input']}\n{ex['output']}"}
|
|
|
|
| 71 |
```python
|
| 72 |
from datasets import load_dataset
|
| 73 |
|
| 74 |
+
ds = load_dataset("lukaskim/cadd-instruct") # default "all" config
|
| 75 |
print(ds["train"][0])
|
| 76 |
```
|
| 77 |
|
|
|
|
| 80 |
```python
|
| 81 |
from datasets import load_dataset
|
| 82 |
|
| 83 |
+
ds = load_dataset("lukaskim/cadd-instruct", split="train")
|
| 84 |
smiley = ds.filter(lambda ex: ex["source"] == "smileyllama")
|
| 85 |
```
|
| 86 |
|
|
|
|
| 89 |
```python
|
| 90 |
from datasets import load_dataset
|
| 91 |
|
| 92 |
+
smiley = load_dataset("lukaskim/cadd-instruct", "smileyllama")
|
| 93 |
+
link = load_dataset("lukaskim/cadd-instruct", "linkllama")
|
| 94 |
```
|
| 95 |
|
| 96 |
Stream instead of downloading everything up front:
|
|
|
|
| 98 |
```python
|
| 99 |
from datasets import load_dataset
|
| 100 |
|
| 101 |
+
ds = load_dataset("lukaskim/cadd-instruct", split="train", streaming=True)
|
| 102 |
for example in ds:
|
| 103 |
print(example["input"], "->", example["output"])
|
| 104 |
break
|
|
|
|
| 109 |
```python
|
| 110 |
from datasets import load_dataset
|
| 111 |
|
| 112 |
+
ds = load_dataset("lukaskim/cadd-instruct", split="train")
|
| 113 |
|
| 114 |
def to_prompt(ex):
|
| 115 |
return {"text": f"{ex['instruction']}\n\n{ex['input']}\n{ex['output']}"}
|