Upload code/train_sft.py with huggingface_hub
Browse files53 unmodified lines54555657575859606 unmodified lines6768697071727374757677787980818283848586878889909192277 unmodified lines3703713723733743753763773783793803812 unmodified lines38438538638738838939053 unmodified lines
PAD_TOKEN_ID = 64000
DOMAIN_NAMES = {DOMAIN_NAMES_V18 = { 0: "gk_polity_history", 1: "coding_tech", 2: "math_logic",6 unmodified lines 9: "identity_greetings"}
DOMAIN_NAMES_V19 = { 0: "identity_greetings", 1: "coding_tech", 2: "math_logic", 3: "reasoning_domain", 4: "empathetic_chitchat", 5: "career_productivity", 6: "recipes_indian_utility", 7: "finance_health_wellness", 8: "translation_multilingual", 9: "gk_polity_history", 10: "multiturn_conversations", 11: "typo_robustness", 12: "hinglish_codemixed", 13: "safety_refusal", 14: "instruction_following"}
DOMAIN_NAMES = DOMAIN_NAMES_V19
# ------------------------------------------------------------------------------# 1. Universal Hardware Prober & Auto-Tuner277 unmodified lines except Exception: pass
global DOMAIN_NAMES if "19" in str(args.version).lower(): DOMAIN_NAMES = DOMAIN_NAMES_V19 else: DOMAIN_NAMES = DOMAIN_NAMES_V18
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") if torch.cuda.is_available(): torch.cuda.empty_cache()2 unmodified lines print(f"🚀 ViuAI Sarus-500M — SFT {args.version.upper()} Ultra-Optimized Master Training Engine") print(f" • Hardware Tier: {hw['tier']} ({hw['desc']})") print(f" • Device Name: {hw['device_name']} | Total VRAM: {hw['vram_gb']:.2f} GB") print(f" • Active Domains: {len(DOMAIN_NAMES)} domains tracked during evaluation") print(f" • Auto-Tuned Batch: Micro-Batch {micro_b} × Grad-Accum {grad_acc} = Effective Batch {eff_batch}") print(f" • NEFTune Noise: alpha = {args.neftune_alpha} (Noisy Embedding Fine-Tuning Active)") print(f" • Length Grouping: Active (LengthGroupedBatchSampler - ~50% padding saved)")code/train_sft.py+28-1