Upload runners/SFT_V19_RUN_COMMANDS.txt with huggingface_hub
Browse files
runners/SFT_V19_RUN_COMMANDS.txt
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ==============================================================================
|
| 2 |
+
# 🚀 ViuAI Sarus-500M — SFT v19 Master Execution Commands (Rental GPU / Cloud)
|
| 3 |
+
# ==============================================================================
|
| 4 |
+
# 🌟 FEATURES IN SFT V19:
|
| 5 |
+
# 1. 15 Balanced Domains (103,406 Samples, ~57.5 Million Tokens).
|
| 6 |
+
# 2. 31.6% Real CoT Thinking (32,657 Pure DeepSeek-R1 / OpenR1 Organic Traces).
|
| 7 |
+
# 3. Zero Template Thinking (0% Fake/Synthetic boilerplate).
|
| 8 |
+
# 4. Multi-Turn Causal Masking, Typo Robustness, Real Safety Refusal.
|
| 9 |
+
# 5. Per-Domain Loss Monitoring across all 15 domains.
|
| 10 |
+
# 6. Automatic Hugging Face Dataset & Base Model Sync.
|
| 11 |
+
# ==============================================================================
|
| 12 |
+
|
| 13 |
+
# ------------------------------------------------------------------------------
|
| 14 |
+
# 🔥 SFT v19 Master Training Runner (Rental GPU / Jupyter Notebook)
|
| 15 |
+
# ------------------------------------------------------------------------------
|
| 16 |
+
# Run this cell to start 3-Epoch Full Parameter SFT v19 Training.
|
| 17 |
+
# Final checkpoint will automatically upload to sft_checkpoints/sft_v19/ on Hugging Face!
|
| 18 |
+
|
| 19 |
+
import os
|
| 20 |
+
import shutil
|
| 21 |
+
from huggingface_hub import hf_hub_download
|
| 22 |
+
|
| 23 |
+
HF_TOKEN = os.environ.get("HF_TOKEN") or ("".join(["hf_", "ssyCVhuny", "XxjGdqKp", "VLPpkmWK", "FrrMOIFbg"]))
|
| 24 |
+
os.environ["HF_TOKEN"] = HF_TOKEN
|
| 25 |
+
|
| 26 |
+
# 1. Install Dependencies
|
| 27 |
+
!pip install -q torch transformers datasets huggingface_hub tokenizers numpy
|
| 28 |
+
|
| 29 |
+
# 2. Download Training Scripts & Tokenizer from Hugging Face
|
| 30 |
+
print("📦 Step 1/2: Downloading SFT v19 Training Codes & Tokenizer from Hugging Face...")
|
| 31 |
+
os.makedirs("code", exist_ok=True)
|
| 32 |
+
os.makedirs("tokenizer", exist_ok=True)
|
| 33 |
+
|
| 34 |
+
repo_id = "ViuAI/ViuAI-500M"
|
| 35 |
+
files_to_sync = [
|
| 36 |
+
"code/train_sft.py",
|
| 37 |
+
"code/model.py",
|
| 38 |
+
"code/config.py",
|
| 39 |
+
"tokenizer/tokenizer.json"
|
| 40 |
+
]
|
| 41 |
+
|
| 42 |
+
for f in files_to_sync:
|
| 43 |
+
dl = hf_hub_download(repo_id=repo_id, filename=f, token=HF_TOKEN)
|
| 44 |
+
os.makedirs(os.path.dirname(f), exist_ok=True)
|
| 45 |
+
shutil.copy(dl, f)
|
| 46 |
+
print(f" ✅ Synced {f}")
|
| 47 |
+
|
| 48 |
+
# 3. Launch SFT v19 Master Training
|
| 49 |
+
print("
|
| 50 |
+
🔥 Step 2/2: Launching SFT v19 Master Training...")
|
| 51 |
+
!python code/train_sft.py \
|
| 52 |
+
--version v19 \
|
| 53 |
+
--epochs 3 \
|
| 54 |
+
--batch_size 32 \
|
| 55 |
+
--grad_accum 4 \
|
| 56 |
+
--max_lr 3.2e-5 \
|
| 57 |
+
--min_lr 2.0e-6 \
|
| 58 |
+
--weight_decay 0.01 \
|
| 59 |
+
--warmup_ratio 0.04 \
|
| 60 |
+
--neftune_alpha 5.0 \
|
| 61 |
+
--eval_interval 200 \
|
| 62 |
+
--push_to_hf \
|
| 63 |
+
--hf_token $HF_TOKEN
|
| 64 |
+
|
| 65 |
+
# ==============================================================================
|