Spaces:
Paused
Paused
Update train.py
Browse files
train.py
CHANGED
|
@@ -8,9 +8,9 @@ from datasets import load_dataset, DatasetDict, Dataset
|
|
| 8 |
from tokenizers import ByteLevelBPETokenizer
|
| 9 |
|
| 10 |
MAX_SEQ_LENGTH = 128
|
| 11 |
-
BATCH_SIZE =
|
| 12 |
-
EPOCHS =
|
| 13 |
-
LEARNING_RATE = 2e-
|
| 14 |
FACTOR = 1024
|
| 15 |
VOCAB_SIZE = 32000
|
| 16 |
INPUT_DATASET = "HuggingFaceTB/smollm-corpus"
|
|
@@ -67,7 +67,7 @@ def format_prompts(examples, tokenizer, isinst):
|
|
| 67 |
formatted_conversation = tokenizer.apply_chat_template(conversation, tokenize=False)
|
| 68 |
texts.append(formatted_conversation)
|
| 69 |
else:
|
| 70 |
-
texts.append(text)
|
| 71 |
return {"text": texts}
|
| 72 |
|
| 73 |
|
|
|
|
| 8 |
from tokenizers import ByteLevelBPETokenizer
|
| 9 |
|
| 10 |
MAX_SEQ_LENGTH = 128
|
| 11 |
+
BATCH_SIZE = 96
|
| 12 |
+
EPOCHS = 2
|
| 13 |
+
LEARNING_RATE = 2e-4
|
| 14 |
FACTOR = 1024
|
| 15 |
VOCAB_SIZE = 32000
|
| 16 |
INPUT_DATASET = "HuggingFaceTB/smollm-corpus"
|
|
|
|
| 67 |
formatted_conversation = tokenizer.apply_chat_template(conversation, tokenize=False)
|
| 68 |
texts.append(formatted_conversation)
|
| 69 |
else:
|
| 70 |
+
texts.append(tokenizer.bos_token + text + tokenizer.eos_token)
|
| 71 |
return {"text": texts}
|
| 72 |
|
| 73 |
|