key value
Browse files- scripts/train.py +2 -1
scripts/train.py
CHANGED
|
@@ -37,8 +37,9 @@ def main():
|
|
| 37 |
dataset = load_dataset("allenai/tulu-v2-sft-mixture", split="train")
|
| 38 |
|
| 39 |
def tokenize_function(examples):
|
|
|
|
| 40 |
return tokenizer(
|
| 41 |
-
examples[
|
| 42 |
truncation=True,
|
| 43 |
max_length=4096,
|
| 44 |
padding="max_length"
|
|
|
|
| 37 |
dataset = load_dataset("allenai/tulu-v2-sft-mixture", split="train")
|
| 38 |
|
| 39 |
def tokenize_function(examples):
|
| 40 |
+
text_key = "content" if "content" in examples else "text"
|
| 41 |
return tokenizer(
|
| 42 |
+
examples[text_key],
|
| 43 |
truncation=True,
|
| 44 |
max_length=4096,
|
| 45 |
padding="max_length"
|