Skip to content

Commit 2709220

Browse files
ErixMerixBTEmudler
authored
fix the tts model dropdown to show the currently selected model (#7306)
* fix the tts model dropdown to show the currently selected model * Update core/config/model_config.go Signed-off-by: Ettore Di Giacinto <[email protected]> --------- Signed-off-by: Ettore Di Giacinto <[email protected]> Co-authored-by: Erixhens Muka <[email protected]> Co-authored-by: Ettore Di Giacinto <[email protected]>
1 parent 4278506 commit 2709220

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

core/config/model_config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ const (
534534

535535
func GetAllModelConfigUsecases() map[string]ModelConfigUsecases {
536536
return map[string]ModelConfigUsecases{
537-
"FLAG_ANY": FLAG_ANY,
537+
// Note: FLAG_ANY is intentionally excluded from this map
538+
// because it's 0 and would always match in HasUsecases checks
538539
"FLAG_CHAT": FLAG_CHAT,
539540
"FLAG_COMPLETION": FLAG_COMPLETION,
540541
"FLAG_EDIT": FLAG_EDIT,
@@ -636,7 +637,7 @@ func (c *ModelConfig) GuessUsecases(u ModelConfigUsecases) bool {
636637
}
637638
}
638639
if (u & FLAG_TTS) == FLAG_TTS {
639-
ttsBackends := []string{"bark-cpp", "piper", "transformers-musicgen"}
640+
ttsBackends := []string{"bark-cpp", "piper", "transformers-musicgen", "kokoro"}
640641
if !slices.Contains(ttsBackends, c.Backend) {
641642
return false
642643
}

core/http/views/tts.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@ <h1 class="text-4xl md:text-5xl font-bold text-[#E5E7EB] mb-4">
3434
<div class="border-b border-[#1E293B] p-5">
3535
<div class="flex flex-col sm:flex-row items-center justify-between gap-4">
3636
<!-- Model Selection -->
37-
<div class="flex items-center">
37+
<div class="flex items-center" x-data="{ link : '{{ if .Model }}tts/{{.Model}}{{ end }}' }">
3838
<label for="model-select" class="mr-3 text-[#94A3B8] font-medium">
3939
<i class="fas fa-microphone-lines text-[#8B5CF6] mr-2"></i>Model:
4040
</label>
41-
<select
41+
<select
4242
id="model-select"
43-
x-data="{ link : '' }"
44-
x-model="link"
45-
x-init="$watch('link', value => window.location = link)"
43+
x-model="link"
44+
@change="window.location = link"
4645
class="bg-[#101827] text-[#E5E7EB] border border-[#1E293B] focus:border-[#8B5CF6] focus:ring-2 focus:ring-[#8B5CF6]/50 rounded-lg shadow-sm p-2.5 appearance-none"
4746
>
4847
<option value="" disabled class="text-[#94A3B8]">Select a model</option>

0 commit comments

Comments
 (0)