File size: 3,595 Bytes
d4101a0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | # Finishes the Lua Nova V1 pipeline on oProfM/LuaNovaDataset:
# Option A E2E (continuation 1000->2000), soup50, Option B BigVGAN FT, distill 2-step, ONNX export.
. "$PSScriptRoot\env.ps1"
$ErrorActionPreference = "Continue"
$exp = Split-Path -Parent $PSScriptRoot
$py = "C:\dev\AjudaEstudos\experiments\tiny-voca-vocos\.venv\Scripts\python.exe"
$runner = Join-Path $PSScriptRoot "run_stage.py"
$src = "C:\dev\AjudaEstudos\released\lua-nova-v1\src"
$ann = Join-Path $exp "data\annotations"
$train = Join-Path $ann "train.jsonl"
$val = Join-Path $ann "validation.jsonl"
$runs = Join-Path $exp "runs"
function Invoke-Stage([string]$stage, [string]$module, [string[]]$a) {
Write-Output "===== $stage ($(Get-Date -Format s))"
& $py $runner --stage $stage --module $module -- @a
if ($LASTEXITCODE -ne 0) { Write-Output "FAILED: $stage"; exit 1 }
}
$e2e2 = Join-Path $runs "cfm_e2e_p2"
if (-not (Test-Path (Join-Path $e2e2 "inference_v5_e2e_step-001000.pt"))) {
Invoke-Stage "cfm_e2e_p2" "lua_nova_v1.training.cfm_e2e" @(
"--train", $train, "--validation", $val,
"--init-v5", (Join-Path $runs "cfm_e2e\inference_v5_e2e_step-001000.pt"),
"--output", $e2e2, "--steps", "1000", "--save-steps", "500", "1000",
"--batch-size", "4", "--grad-accum", "3", "--crop-frames", "40",
"--lr", "2.52e-5", "--min-lr", "4e-6", "--warmup", "20", "--device", "cuda")
}
$soup = Join-Path $runs "cfm_e2e_p2\inference_v5_soup50.pt"
if (-not (Test-Path $soup)) {
Write-Output "===== soup50"
& $py -c "import sys; sys.path.insert(0, r'$src'); from lua_nova_v1.utils import soup_checkpoints; soup_checkpoints(r'$runs\cfm_v5\inference_v5_ema.pt', r'$e2e2\inference_v5_e2e_step-000500.pt', r'$soup', alpha=0.5)"
if ($LASTEXITCODE -ne 0) { Write-Output "FAILED: soup"; exit 1 }
}
$voc = Join-Path $runs "bigvgan_base_optB"
if (-not (Test-Path (Join-Path $voc "bigvgan_ft_step-002000.pt"))) {
Invoke-Stage "bigvgan_optB" "lua_nova_v1.training.vocoder_ft" @(
"--train", $train, "--validation", $val, "--cfm-ckpt", $soup,
"--cfm-steps", "8", "--cfm-temp", "0.35", "--sway-coef", "-0.5",
"--model-id", "nvidia/bigvgan_base_24khz_100band", "--pretrained-disc", "--disc-warmup", "0",
"--output", $voc, "--steps", "2000", "--save-steps", "500", "1000", "1500", "2000",
"--batch-size", "6", "--grad-accum", "2", "--crop-frames", "32", "--cfm-prob", "0.60",
"--lr-g", "1e-5", "--min-lr-g", "1e-6", "--warmup-g", "100",
"--lr-d", "1e-5", "--lr-d-post", "1e-5", "--min-lr-d", "1e-6",
"--val-every", "250", "--log-every", "10", "--device", "cuda")
}
$fast = Join-Path $runs "cfm_v5_fast2"
if (-not (Test-Path (Join-Path $fast "inference_v5_fast2_step-003000.pt"))) {
Invoke-Stage "distill_fast2" "lua_nova_v1.training.distill" @(
"--train", $train, "--validation", $val, "--teacher", $soup, "--output", $fast,
"--steps", "3000", "--teacher-steps", "8", "--teacher-sway", "-0.5", "--teacher-temp", "0.35",
"--student-steps", "2", "--lr", "1e-4", "--save-every", "3000", "--device", "cuda")
}
Invoke-Stage "onnx_export" "lua_nova_v1.export.onnx_export" @(
"--cfm", (Join-Path $fast "inference_v5_fast2_step-003000.pt"),
"--vocoder", (Join-Path $voc "bigvgan_ft_step-002000.pt"),
"--out-dir", (Join-Path $runs "onnx_v5"),
"--cfm-name", "cfm_v5_fast2.onnx", "--vocoder-name", "bigvgan_base_ft.onnx",
"--steps", "2", "--solver", "euler", "--sway-coef", "0.0", "--temperature", "0.35", "--verify")
Write-Output "===== PIPELINE DONE ($(Get-Date -Format s))"
|