fix: elevenlabs cloned voices do not show up in webui after entering API key (#2107)

This commit is contained in:
pixel 2023-05-16 17:21:36 -06:00 committed by GitHub
parent 7584d46c29
commit 458a627ab9
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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