Upload code/train_sft.py with huggingface_hub
Browse files- code/train_sft.py +28 -1
code/train_sft.py
CHANGED
|
@@ -54,7 +54,7 @@ from config import ViuAIConfig, ModelArgs
|
|
| 54 |
|
| 55 |
PAD_TOKEN_ID = 64000
|
| 56 |
|
| 57 |
-
|
| 58 |
0: "gk_polity_history",
|
| 59 |
1: "coding_tech",
|
| 60 |
2: "math_logic",
|
|
@@ -67,6 +67,26 @@ DOMAIN_NAMES = {
|
|
| 67 |
9: "identity_greetings"
|
| 68 |
}
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
# ------------------------------------------------------------------------------
|
| 72 |
# 1. Universal Hardware Prober & Auto-Tuner
|
|
@@ -350,6 +370,12 @@ def main():
|
|
| 350 |
except Exception:
|
| 351 |
pass
|
| 352 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 354 |
if torch.cuda.is_available():
|
| 355 |
torch.cuda.empty_cache()
|
|
@@ -358,6 +384,7 @@ def main():
|
|
| 358 |
print(f"🚀 ViuAI Sarus-500M — SFT {args.version.upper()} Ultra-Optimized Master Training Engine")
|
| 359 |
print(f" • Hardware Tier: {hw['tier']} ({hw['desc']})")
|
| 360 |
print(f" • Device Name: {hw['device_name']} | Total VRAM: {hw['vram_gb']:.2f} GB")
|
|
|
|
| 361 |
print(f" • Auto-Tuned Batch: Micro-Batch {micro_b} × Grad-Accum {grad_acc} = Effective Batch {eff_batch}")
|
| 362 |
print(f" • NEFTune Noise: alpha = {args.neftune_alpha} (Noisy Embedding Fine-Tuning Active)")
|
| 363 |
print(f" • Length Grouping: Active (LengthGroupedBatchSampler - ~50% padding saved)")
|
|
|
|
| 54 |
|
| 55 |
PAD_TOKEN_ID = 64000
|
| 56 |
|
| 57 |
+
DOMAIN_NAMES_V18 = {
|
| 58 |
0: "gk_polity_history",
|
| 59 |
1: "coding_tech",
|
| 60 |
2: "math_logic",
|
|
|
|
| 67 |
9: "identity_greetings"
|
| 68 |
}
|
| 69 |
|
| 70 |
+
DOMAIN_NAMES_V19 = {
|
| 71 |
+
0: "identity_greetings",
|
| 72 |
+
1: "coding_tech",
|
| 73 |
+
2: "math_logic",
|
| 74 |
+
3: "reasoning_domain",
|
| 75 |
+
4: "empathetic_chitchat",
|
| 76 |
+
5: "career_productivity",
|
| 77 |
+
6: "recipes_indian_utility",
|
| 78 |
+
7: "finance_health_wellness",
|
| 79 |
+
8: "translation_multilingual",
|
| 80 |
+
9: "gk_polity_history",
|
| 81 |
+
10: "multiturn_conversations",
|
| 82 |
+
11: "typo_robustness",
|
| 83 |
+
12: "hinglish_codemixed",
|
| 84 |
+
13: "safety_refusal",
|
| 85 |
+
14: "instruction_following"
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
DOMAIN_NAMES = DOMAIN_NAMES_V19
|
| 89 |
+
|
| 90 |
|
| 91 |
# ------------------------------------------------------------------------------
|
| 92 |
# 1. Universal Hardware Prober & Auto-Tuner
|
|
|
|
| 370 |
except Exception:
|
| 371 |
pass
|
| 372 |
|
| 373 |
+
global DOMAIN_NAMES
|
| 374 |
+
if "19" in str(args.version).lower():
|
| 375 |
+
DOMAIN_NAMES = DOMAIN_NAMES_V19
|
| 376 |
+
else:
|
| 377 |
+
DOMAIN_NAMES = DOMAIN_NAMES_V18
|
| 378 |
+
|
| 379 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 380 |
if torch.cuda.is_available():
|
| 381 |
torch.cuda.empty_cache()
|
|
|
|
| 384 |
print(f"🚀 ViuAI Sarus-500M — SFT {args.version.upper()} Ultra-Optimized Master Training Engine")
|
| 385 |
print(f" • Hardware Tier: {hw['tier']} ({hw['desc']})")
|
| 386 |
print(f" • Device Name: {hw['device_name']} | Total VRAM: {hw['vram_gb']:.2f} GB")
|
| 387 |
+
print(f" • Active Domains: {len(DOMAIN_NAMES)} domains tracked during evaluation")
|
| 388 |
print(f" • Auto-Tuned Batch: Micro-Batch {micro_b} × Grad-Accum {grad_acc} = Effective Batch {eff_batch}")
|
| 389 |
print(f" • NEFTune Noise: alpha = {args.neftune_alpha} (Noisy Embedding Fine-Tuning Active)")
|
| 390 |
print(f" • Length Grouping: Active (LengthGroupedBatchSampler - ~50% padding saved)")
|