#!/usr/bin/env powershell <# .SYNOPSIS Launch F5-TTS training FROM SCRATCH (no pretrained checkpoint). .DESCRIPTION This trains a fresh F5-TTS model on your Sinhala dataset without loading any pretrained weights. Use this alongside the IndicF5 fine-tuning run to compare approaches. The experiment name is "F5TTS_Sinhala_Scratch" to avoid colliding with the IndicF5 fine-tune checkpoints in "F5TTS_v1_Base". .EXAMPLE # Standard from-scratch training .\scripts\train_from_scratch.ps1 # With custom hyperparameters .\scripts\train_from_scratch.ps1 -Epochs 200 -LearningRate 5e-5 # Detached mode (background) .\scripts\train_from_scratch.ps1 -LaunchMode detached #> param( [string]$DatasetName = "sinhala_tts_batch03_scratch", [string]$TokenizerPath = "data/sinhala_vocab/vocab.txt", [string]$ExpName = "F5TTS_v1_Base", [int]$Epochs = 100, [double]$LearningRate = 1e-5, [int]$BatchSizePerGpu = 600, [string]$BatchSizeType = "frame", [int]$MaxSamples = 8, [int]$GradAccumulationSteps = 2, [int]$NumWarmupUpdates = 200, [int]$SavePerUpdates = 5000, [int]$LastPerUpdates = 2000, [string]$Logger = "tensorboard", [ValidateSet("foreground", "detached")] [string]$LaunchMode = "foreground", [int]$KeepLastNCheckpoints = 3 ) $ErrorActionPreference = "Stop" $repoRoot = Resolve-Path (Join-Path $PSScriptRoot "..") Write-Output "Launching F5-TTS training FROM SCRATCH..." Write-Output " Experiment: $ExpName" Write-Output " Dataset: $DatasetName" Write-Output " Epochs: $Epochs" Write-Output " No pretrained checkpoint will be loaded." $scriptPath = Join-Path $repoRoot "scripts\run_finetune_safe.ps1" & $scriptPath ` -ExpName $ExpName ` -DatasetName $DatasetName ` -TokenizerPath $TokenizerPath ` -Epochs $Epochs ` -LearningRate $LearningRate ` -BatchSizePerGpu $BatchSizePerGpu ` -BatchSizeType $BatchSizeType ` -MaxSamples $MaxSamples ` -GradAccumulationSteps $GradAccumulationSteps ` -BnbOptimizer ` -NumWarmupUpdates $NumWarmupUpdates ` -SavePerUpdates $SavePerUpdates ` -LastPerUpdates $LastPerUpdates ` -Logger $Logger ` -LaunchMode $LaunchMode ` -KeepLastNCheckpoints $KeepLastNCheckpoints ` -FinetuneWrapper "scripts\train_f5.py"