ViuAI commited on
Commit
716b984
Β·
verified Β·
1 Parent(s): 237250a

Update runners/KAGGLE_TRAIN_SARUS_SFT.txt with user enhancements

Browse files
Files changed (1) hide show
  1. runners/KAGGLE_TRAIN_SARUS_SFT.txt +68 -67
runners/KAGGLE_TRAIN_SARUS_SFT.txt CHANGED
@@ -1,67 +1,68 @@
1
- # ==============================================================================
2
- # πŸš€ ViuAI Sarus-500M β€” STEP 2: Kaggle Master SFT v1 Training Engine
3
- # ==============================================================================
4
- # Run this entire block in a single Kaggle Notebook cell (Accelerator: GPU T4 x 2 or P100)
5
- # Auto-syncs:
6
- # β€’ Base weights: ViuAI/ViuAI-500M (checkpoints/ckpt_latest.pt)
7
- # β€’ Tokenized data: ViuAI/viuai-500m-sft-tokenized (sft_v1)
8
- # β€’ Training Engine: code/train_sft.py
9
- # ==============================================================================
10
-
11
- import os, sys, shutil, subprocess
12
-
13
- # 1. Environment & Auth Token
14
- HF_TOKEN = os.environ.get("HF_TOKEN") or ("".join(["hf_", "ssyCVhuny", "XxjGdqKp", "VLPpkmWK", "FrrMOIFbg"]))
15
- os.environ["HF_TOKEN"] = HF_TOKEN
16
- os.environ["HF_HUB_DISABLE_PROGRESS_BARS"] = "1"
17
- os.environ["TOKENIZERS_PARALLELISM"] = "false"
18
- os.environ["PYTHONUNBUFFERED"] = "1"
19
-
20
- # 2. Dependencies
21
- !pip install -q torch tokenizers huggingface_hub numpy
22
-
23
- from huggingface_hub import hf_hub_download
24
- from huggingface_hub.utils import disable_progress_bars
25
- disable_progress_bars()
26
-
27
- # 3. Setup Workspace Folders
28
- os.makedirs("code", exist_ok=True)
29
- os.makedirs("tokenizer", exist_ok=True)
30
- os.makedirs("checkpoints", exist_ok=True)
31
- os.makedirs("tokenized_data/sft_v1", exist_ok=True)
32
-
33
- # 4. Fetch Architecture & Training Script
34
- print("πŸ“¦ Fetching Sarus Model Architecture & SFT Training Engine from Hugging Face...")
35
- code_files = [
36
- ("code/model.py", "code/model.py"),
37
- ("code/config.py", "code/config.py"),
38
- ("code/train_sft.py", "code/train_sft.py"),
39
- ("tokenizer/tokenizer.json", "tokenizer/tokenizer.json"),
40
- ]
41
-
42
- for src, dst in code_files:
43
- p = hf_hub_download(repo_id="ViuAI/ViuAI-500M", filename=src, token=HF_TOKEN)
44
- shutil.copy(p, dst)
45
- print(" βœ… Architecture and training engine ready.")
46
-
47
- # 5. Fetch Base Checkpoint (ckpt_latest.pt ~5.9GB) - Skipped if already present
48
- base_ckpt = "checkpoints/ckpt_latest.pt"
49
- if not os.path.exists(base_ckpt):
50
- print("πŸ“₯ Downloading base checkpoint ckpt_latest.pt from ViuAI/ViuAI-500M...")
51
- dl_ckpt = hf_hub_download(repo_id="ViuAI/ViuAI-500M", filename=base_ckpt, token=HF_TOKEN)
52
- if dl_ckpt != base_ckpt:
53
- shutil.copy(dl_ckpt, base_ckpt)
54
- print(" βœ… Base checkpoint ready.")
55
-
56
- # 6. Execute Master SFT v1 Training Engine
57
- print("\nπŸ”₯ Launching Sarus SFT v1 Master Training on GPU...")
58
- !python -u code/train_sft.py \
59
- --version v1 \
60
- --epochs 3 \
61
- --batch_size 4 \
62
- --grad_accum 32 \
63
- --max_lr 3.2e-5 \
64
- --min_lr 2.0e-6 \
65
- --neftune_alpha 5.0 \
66
- --eval_interval 500 \
67
- --push_to_hf
 
 
1
+ # ==============================================================================
2
+ # πŸš€ ViuAI Sarus-500M β€” STEP 2: Kaggle Master SFT v1 Training Engine
3
+ # ==============================================================================
4
+ # Run this entire block in a single Kaggle Notebook cell (Accelerator: GPU T4 x 2 or P100)
5
+ # Auto-syncs:
6
+ # β€’ Base weights: ViuAI/ViuAI-500M (checkpoints/ckpt_latest.pt)
7
+ # β€’ Tokenized data: ViuAI/viuai-500m-sft-tokenized (sft_v1)
8
+ # β€’ Training Engine: code/train_sft.py
9
+ # ==============================================================================
10
+
11
+ import os, sys, shutil, subprocess
12
+
13
+ # 1. Environment & Auth Token
14
+ HF_TOKEN = os.environ.get("HF_TOKEN")
15
+ if HF_TOKEN:
16
+ os.environ["HF_TOKEN"] = HF_TOKEN
17
+ os.environ["HF_HUB_DISABLE_PROGRESS_BARS"] = "1"
18
+ os.environ["TOKENIZERS_PARALLELISM"] = "false"
19
+ os.environ["PYTHONUNBUFFERED"] = "1"
20
+
21
+ # 2. Dependencies
22
+ !pip install -q torch tokenizers huggingface_hub numpy
23
+
24
+ from huggingface_hub import hf_hub_download
25
+ from huggingface_hub.utils import disable_progress_bars
26
+ disable_progress_bars()
27
+
28
+ # 3. Setup Workspace Folders
29
+ os.makedirs("code", exist_ok=True)
30
+ os.makedirs("tokenizer", exist_ok=True)
31
+ os.makedirs("checkpoints", exist_ok=True)
32
+ os.makedirs("tokenized_data/sft_v1", exist_ok=True)
33
+
34
+ # 4. Fetch Architecture & Training Script
35
+ print("πŸ“¦ Fetching Sarus Model Architecture & SFT Training Engine from Hugging Face...")
36
+ code_files = [
37
+ ("code/model.py", "code/model.py"),
38
+ ("code/config.py", "code/config.py"),
39
+ ("code/train_sft.py", "code/train_sft.py"),
40
+ ("tokenizer/tokenizer.json", "tokenizer/tokenizer.json"),
41
+ ]
42
+
43
+ for src, dst in code_files:
44
+ p = hf_hub_download(repo_id="ViuAI/ViuAI-500M", filename=src, token=HF_TOKEN)
45
+ shutil.copy(p, dst)
46
+ print(" βœ… Architecture and training engine ready.")
47
+
48
+ # 5. Fetch Base Checkpoint (ckpt_latest.pt ~5.9GB) - Skipped if already present
49
+ base_ckpt = "checkpoints/ckpt_latest.pt"
50
+ if not os.path.exists(base_ckpt):
51
+ print("πŸ“₯ Downloading base checkpoint ckpt_latest.pt from ViuAI/ViuAI-500M...")
52
+ dl_ckpt = hf_hub_download(repo_id="ViuAI/ViuAI-500M", filename=base_ckpt, token=HF_TOKEN)
53
+ if dl_ckpt != base_ckpt:
54
+ shutil.copy(dl_ckpt, base_ckpt)
55
+ print(" βœ… Base checkpoint ready.")
56
+
57
+ # 6. Execute Master SFT v1 Training Engine
58
+ print("\nπŸ”₯ Launching Sarus SFT v1 Master Training on GPU...")
59
+ !python -u code/train_sft.py \
60
+ --version v1 \
61
+ --epochs 3 \
62
+ --batch_size 4 \
63
+ --grad_accum 32 \
64
+ --max_lr 3.2e-5 \
65
+ --min_lr 2.0e-6 \
66
+ --neftune_alpha 5.0 \
67
+ --eval_interval 500 \
68
+ --push_to_hf