From 458a627ab954da981d34957a0e57c6fc62035a80 Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 16 May 2023 17:21:36 -0600 Subject: [PATCH] fix: elevenlabs cloned voices do not show up in webui after entering API key (#2107) --- extensions/elevenlabs_tts/script.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extensions/elevenlabs_tts/script.py b/extensions/elevenlabs_tts/script.py index 18545030..327a9a11 100644 --- a/extensions/elevenlabs_tts/script.py +++ b/extensions/elevenlabs_tts/script.py @@ -17,6 +17,12 @@ voices = None wav_idx = 0 +def update_api_key(key): + params['api_key'] = key + if key is not None: + elevenlabs.set_api_key(key) + + def refresh_voices(): global params your_voices = elevenlabs.voices() @@ -167,7 +173,7 @@ def ui(): # Event functions to update the parameters in the backend activate.change(lambda x: params.update({'activate': x}), activate, None) voice.change(lambda x: params.update({'selected_voice': x}), voice, None) - api_key.change(lambda x: params.update({'api_key': x}), api_key, None) + api_key.change(update_api_key, api_key, None) # connect.click(check_valid_api, [], connection_status) refresh.click(refresh_voices_dd, [], voice) # Event functions to update the parameters in the backend