parseOptions reads opts.Options[] and pulls out the per-role overrides documented in the gallery entries. Accepts both "key=value" (gallery YAML style) and "key:value" (Make-target / env-var style).
(opts []string, relTo string)
| 161 | // overrides documented in the gallery entries. Accepts both "key=value" |
| 162 | // (gallery YAML style) and "key:value" (Make-target / env-var style). |
| 163 | func (v *VibevoiceCpp) parseOptions(opts []string, relTo string) string { |
| 164 | role := "" |
| 165 | for _, raw := range opts { |
| 166 | k, val, ok := strings.Cut(raw, "=") |
| 167 | if !ok { |
| 168 | k, val, ok = strings.Cut(raw, ":") |
| 169 | if !ok { |
| 170 | continue |
| 171 | } |
| 172 | } |
| 173 | key := strings.TrimSpace(k) |
| 174 | val = strings.TrimSpace(val) |
| 175 | switch key { |
| 176 | case "type": |
| 177 | role = strings.ToLower(val) |
| 178 | case "tokenizer": |
| 179 | v.tokenizer = resolvePath(val, relTo) |
| 180 | case "voice": |
| 181 | v.voice = resolvePath(val, relTo) |
| 182 | case "tts_model": |
| 183 | v.ttsModel = resolvePath(val, relTo) |
| 184 | case "asr_model": |
| 185 | v.asrModel = resolvePath(val, relTo) |
| 186 | } |
| 187 | } |
| 188 | return role |
| 189 | } |
| 190 | |
| 191 | // parseRefAudio splits a comma-separated audio_path value into a |
| 192 | // resolved list of WAVs. The 1.5B model uses one WAV per speaker; |
no test coverage detected