-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch_indextts2.ps1
More file actions
91 lines (76 loc) · 2.36 KB
/
launch_indextts2.ps1
File metadata and controls
91 lines (76 loc) · 2.36 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
param(
[Parameter(Mandatory = $true)]
[string]$Text,
[string]$Speaker = 'checkpoints/speaker_16k.wav',
[string]$Output = 'debug/quick_run.wav',
[ValidateSet('VoiceClone', 'EmotionAudio', 'EmotionAudioBlend', 'EmotionVector', 'EmotionText')]
[string]$Mode = 'VoiceClone',
[string]$EmotionAudio = 'speaker.wav',
[double]$EmotionAlpha = 1.0,
[string]$EmotionVector = '0.60,0.00,0.00,0.00,0.00,0.00,0.10,0.20',
[string]$EmotionText = 'I feel happy and excited today.',
[double]$Temperature = 0.8,
[int]$TopK = 0,
[double]$TopP = 1.0,
[double]$RepetitionPenalty = 1.05,
[int]$FlowSteps = 25,
[double]$FlowCfgRate = 0.7,
[switch]$Cpu,
[switch]$NoDerumble,
[double]$DerumbleCutoffHz = 180.0,
[switch]$SkipBuild
)
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
$exe = '.\target\release\indextts2.exe'
if (-not $SkipBuild -and -not (Test-Path $exe)) {
$env:CUDA_COMPUTE_CAP = '90'
cargo build --release --features cuda
}
if (-not (Test-Path $Speaker)) {
throw "Speaker file not found: $Speaker"
}
$outDir = Split-Path -Parent $Output
if ($outDir -and -not (Test-Path $outDir)) {
New-Item -ItemType Directory -Force -Path $outDir | Out-Null
}
$args = @('infer')
if ($Cpu) {
$args = @('--cpu', 'infer')
}
$args += @(
'--text', $Text,
'--speaker', $Speaker,
'--output', $Output,
'--temperature', "$Temperature",
'--top-k', "$TopK",
'--top-p', "$TopP",
'--repetition-penalty', "$RepetitionPenalty",
'--flow-steps', "$FlowSteps",
'--flow-cfg-rate', "$FlowCfgRate"
)
if (-not $NoDerumble) {
$args += @('--de-rumble', '--de-rumble-cutoff-hz', "$DerumbleCutoffHz")
}
switch ($Mode) {
'EmotionAudio' {
$args += @('--emotion-audio', $EmotionAudio, '--emotion-alpha', "$EmotionAlpha")
}
'EmotionAudioBlend' {
$args += @('--emotion-audio', $EmotionAudio, '--emotion-alpha', "$EmotionAlpha")
}
'EmotionVector' {
$args += @('--emotion-vector', $EmotionVector, '--emotion-alpha', "$EmotionAlpha")
}
'EmotionText' {
$args += @('--use-emo-text', '--emo-text', $EmotionText, '--emotion-alpha', "$EmotionAlpha")
}
default {
}
}
Write-Host "Running: $exe $($args -join ' ')"
& $exe @args
if ($LASTEXITCODE -ne 0) {
throw "Inference failed with exit code $LASTEXITCODE"
}
Write-Host "Done: $Output"