Minor changes
This commit is contained in:
parent
5389fce8e1
commit
104212529f
4 changed files with 13 additions and 21 deletions
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue