Spaces:
Paused
Paused
nroggendorff
commited on
Commit
•
b06da2c
1
Parent(s):
ee5e28f
Update train.py
Browse files
train.py
CHANGED
@@ -16,7 +16,7 @@ VOCAB_SIZE = 32000
|
|
16 |
INPUT_DATASET = "HuggingFaceTB/smollm-corpus"
|
17 |
INSTRUCT_DATASET = "nroggendorff/elephant"
|
18 |
OUTPUT_REPO = "smallama"
|
19 |
-
INSTRUCT_FINETUNE_BOOL =
|
20 |
FP16 = False
|
21 |
WARMUP_STEPS = 0
|
22 |
DECAY = 0
|
@@ -25,11 +25,11 @@ PUSH_TO_HUB = True
|
|
25 |
|
26 |
def load_data():
|
27 |
if not INSTRUCT_FINETUNE_BOOL:
|
28 |
-
dataset = load_dataset(INSTRUCT_DATASET, split="train", streaming=True)
|
29 |
-
dataset = Dataset.from_generator(lambda: dataset.take(int(5e+4)))
|
30 |
-
else:
|
31 |
dataset = load_dataset(INPUT_DATASET, "cosmopedia-v2", split="train", streaming=True)
|
32 |
dataset = Dataset.from_generator(lambda: dataset.take(int(6e+4)))
|
|
|
|
|
|
|
33 |
return dataset
|
34 |
|
35 |
def create_tokenizer(training_corpus):
|
|
|
16 |
INPUT_DATASET = "HuggingFaceTB/smollm-corpus"
|
17 |
INSTRUCT_DATASET = "nroggendorff/elephant"
|
18 |
OUTPUT_REPO = "smallama"
|
19 |
+
INSTRUCT_FINETUNE_BOOL = False
|
20 |
FP16 = False
|
21 |
WARMUP_STEPS = 0
|
22 |
DECAY = 0
|
|
|
25 |
|
26 |
def load_data():
|
27 |
if not INSTRUCT_FINETUNE_BOOL:
|
|
|
|
|
|
|
28 |
dataset = load_dataset(INPUT_DATASET, "cosmopedia-v2", split="train", streaming=True)
|
29 |
dataset = Dataset.from_generator(lambda: dataset.take(int(6e+4)))
|
30 |
+
else:
|
31 |
+
dataset = load_dataset(INSTRUCT_DATASET, split="train", streaming=True)
|
32 |
+
dataset = Dataset.from_generator(lambda: dataset.take(int(6e+4)))
|
33 |
return dataset
|
34 |
|
35 |
def create_tokenizer(training_corpus):
|