Upload folder using huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566#!/usr/bin/env bash# ==============================================================================# ๐ ViuAI Sarus-500M โ Master SFT v15 End-to-End Rental GPU Automation Runner# ==============================================================================# This script automates everything on a fresh rental GPU instance:# 1. Environment Setup & Dependency Installation# 2. Hugging Face Authentication check# 3. STAGE 1: English Foundation + Identity Training (25k samples)# 4. STAGE 2: Hinglish Adaptation + Identity Training (25k samples)# 5. Automatic Push of both Checkpoints to Hugging Face Hub# ==============================================================================
set -e
echo "================================================================================"echo "๐ ViuAI Sarus-500M โ SFT v15 Master 2-Stage Training Launch"echo "================================================================================"
# 1. Verify Hugging Face Tokenif [ -z "$HF_TOKEN" ]; then echo "โ ๏ธ WARNING: HF_TOKEN environment variable is not set." echo "Please run: export HF_TOKEN="your_huggingface_token" before running this script."fi
# 2. Install Required Python Packagesecho ""echo "๐ฆ Step 1/4: Installing dependencies..."pip install --upgrade pippip install torch transformers huggingface_hub numpy tqdm
# 3. Check GPU Detailsecho ""echo "๐ฅ๏ธ Step 2/4: Inspecting GPU Hardware..."python3 -c "import torchprint(f'PyTorch Version: {torch.__version__}')if torch.cuda.is_available(): print(f'GPU Detected: {torch.cuda.get_device_name(0)}') print(f'VRAM Total: {torch.cuda.get_device_properties(0).total_memory / (1024**3):.2f} GB') print(f'BF16 Supported: {torch.cuda.is_bf16_supported()}')else: print('โ ๏ธ WARNING: No GPU detected! Running on CPU (will be slow).')"
# 4. Run STAGE 1: English Foundation Training (25k samples)echo ""echo "================================================================================"echo "๐ฅ Step 3/4: Launching STAGE 1 (English Foundation + Identity)"echo "================================================================================"python3 code/train_sft.py --stage stage1 --epochs 2 --max_lr 1.8e-5 --push_to_hf --hf_token "$HF_TOKEN"
echo ""echo "โ
STAGE 1 COMPLETE & SYNCED TO HUGGING FACE!"
# 5. Run STAGE 2: Hinglish Adaptation Training (25k samples)echo ""echo "================================================================================"echo "๐ฅ Step 4/4: Launching STAGE 2 (Hinglish Adaptation + Identity)"echo "================================================================================"python3 code/train_sft.py --stage stage2 --epochs 2 --max_lr 1.5e-5 --push_to_hf --hf_token "$HF_TOKEN"
echo ""echo "================================================================================"echo "๐ ALL SFT v15 STAGES COMPLETED SUCCESSFULLY!"echo "Checkpoints are live at: https://huggingface.co/ViuAI/ViuAI-500M"echo "================================================================================"code/run_sft_v15.shAdded+66