Spaces:
Starting
on
A100
Starting
on
A100
nroggendorff
commited on
Commit
•
fb56e7c
1
Parent(s):
b0d3d22
Update train.py
Browse files
train.py
CHANGED
@@ -16,8 +16,8 @@ VOCAB_SIZE = 32000
|
|
16 |
INPUT_DATASET = "HuggingFaceTB/smollm-corpus"
|
17 |
INSTRUCT_DATASET = "nroggendorff/elephant"
|
18 |
OUTPUT_REPO = "nroggendorff/smallama"
|
19 |
-
INSTRUCT_FINETUNE_BOOL =
|
20 |
-
FP16 =
|
21 |
WARMUP_STEPS = 0
|
22 |
DECAY = 0
|
23 |
GRADIENT_ACCUMULATION_STEPS = 1
|
@@ -26,10 +26,10 @@ PUSH_TO_HUB = True
|
|
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(
|
30 |
else:
|
31 |
dataset = load_dataset(INSTRUCT_DATASET, split="train", streaming=True)
|
32 |
-
dataset = Dataset.from_generator(lambda: dataset.take(int(
|
33 |
return dataset
|
34 |
|
35 |
def create_tokenizer(training_corpus):
|
|
|
16 |
INPUT_DATASET = "HuggingFaceTB/smollm-corpus"
|
17 |
INSTRUCT_DATASET = "nroggendorff/elephant"
|
18 |
OUTPUT_REPO = "nroggendorff/smallama"
|
19 |
+
INSTRUCT_FINETUNE_BOOL = False
|
20 |
+
FP16 = True
|
21 |
WARMUP_STEPS = 0
|
22 |
DECAY = 0
|
23 |
GRADIENT_ACCUMULATION_STEPS = 1
|
|
|
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(2e+6)))
|
30 |
else:
|
31 |
dataset = load_dataset(INSTRUCT_DATASET, split="train", streaming=True)
|
32 |
+
dataset = Dataset.from_generator(lambda: dataset.take(int(3e+6)))
|
33 |
return dataset
|
34 |
|
35 |
def create_tokenizer(training_corpus):
|