Minor changes

This commit is contained in:
oobabooga 2023-03-22 15:55:03 -03:00 committed by GitHub
parent 5389fce8e1
commit 104212529f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 21 deletions

View file

@ -1,13 +1,11 @@
import re
from pathlib import Path
import gradio as gr
import modules.shared as shared
from elevenlabslib import ElevenLabsUser
from elevenlabslib.helpers import save_bytes_to_path
import re
import modules.shared as shared
params = {
'activate': True,
'api_key': '12345',
@ -54,7 +52,6 @@ def refresh_voices():
return
def remove_surrounded_chars(string):
# regexp is way faster than repeated string concatenation!
# this expression matches to 'as few symbols as possible (0 upwards) between any asterisks' OR
# 'as few symbols as possible (0 upwards) between an asterisk and the end of the string'
return re.sub('\*[^\*]*?(\*|$)','',string)
@ -113,4 +110,4 @@ def ui():
voice.change(lambda x: params.update({'selected_voice': x}), voice, None)
api_key.change(lambda x: params.update({'api_key': x}), api_key, None)
connect.click(check_valid_api, [], connection_status)
connect.click(refresh_voices, [], voice)
connect.click(refresh_voices, [], voice)