From aa83134bde4a6b018bc4efeb17ea61fb7bfeb84e Mon Sep 17 00:00:00 2001 From: vkhoilq <53245497+vkhoilq@users.noreply.github.com> Date: Mon, 29 Jun 2026 13:55:38 +0700 Subject: [PATCH] Fix filtering of English voices in train.py fix bug 'dict' object has no attribute 'startswith' --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index f9ed679..3c3b5b1 100644 --- a/train.py +++ b/train.py @@ -39,7 +39,7 @@ def get_kokoro_voices(kokoro_url: str) -> list: r = requests.get(f"{kokoro_url}/v1/audio/voices", timeout=5) voices = r.json().get("voices", []) # Filter to English voices (a = American, b = British) - english = [v for v in voices if v.startswith(('af_', 'am_', 'bf_', 'bm_'))] + english = [v['id'] for v in voices if v['id'].startswith(('af_', 'am_', 'bf_', 'bm_'))] print(f"Kokoro voices available: {len(english)}") return english except Exception as e: