Spaces:
Paused
Paused
nroggendorff
commited on
Commit
•
b225b76
1
Parent(s):
892e2f9
Update train.py
Browse files
train.py
CHANGED
@@ -8,6 +8,7 @@ from transformers import (
|
|
8 |
)
|
9 |
from datasets import load_dataset, Dataset
|
10 |
from tokenizers import ByteLevelBPETokenizer
|
|
|
11 |
from torch.utils.data import DataLoader
|
12 |
from itertools import islice
|
13 |
|
@@ -29,6 +30,13 @@ WEIGHT_DECAY = 0
|
|
29 |
GRADIENT_ACCUMULATION_STEPS = 1
|
30 |
PUSH_TO_HUB = True
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
def load_data():
|
33 |
if not INSTRUCT_FINETUNE_BOOL:
|
34 |
dataset = load_dataset(INPUT_DATASET, "cosmopedia-v2", split="train", streaming=True)
|
@@ -237,4 +245,4 @@ def main(push_to_hub=True, is_inst_finetune=False):
|
|
237 |
|
238 |
if __name__ == "__main__":
|
239 |
main(PUSH_TO_HUB, INSTRUCT_FINETUNE_BOOL)
|
240 |
-
|
|
|
8 |
)
|
9 |
from datasets import load_dataset, Dataset
|
10 |
from tokenizers import ByteLevelBPETokenizer
|
11 |
+
from huggingface_hub import HfApi
|
12 |
from torch.utils.data import DataLoader
|
13 |
from itertools import islice
|
14 |
|
|
|
30 |
GRADIENT_ACCUMULATION_STEPS = 1
|
31 |
PUSH_TO_HUB = True
|
32 |
|
33 |
+
class Space:
|
34 |
+
def __init__(self):
|
35 |
+
self.api = HfApi()
|
36 |
+
self.pause = lambda: self.api.pause_space("nroggendorff/train-llama")
|
37 |
+
|
38 |
+
space = Space()
|
39 |
+
|
40 |
def load_data():
|
41 |
if not INSTRUCT_FINETUNE_BOOL:
|
42 |
dataset = load_dataset(INPUT_DATASET, "cosmopedia-v2", split="train", streaming=True)
|
|
|
245 |
|
246 |
if __name__ == "__main__":
|
247 |
main(PUSH_TO_HUB, INSTRUCT_FINETUNE_BOOL)
|
248 |
+
space.pause()
|