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,12 +1,11 @@
import re
import time
from pathlib import Path
import gradio as gr
import torch
import re
import modules.chat as chat
import modules.shared as shared
import torch
torch._C._jit_set_profiling_mode(False)
@ -47,7 +46,6 @@ def load_model():
model = load_model()
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)
@ -163,4 +161,4 @@ def ui():
autoplay.change(lambda x: params.update({"autoplay": x}), autoplay, None)
voice.change(lambda x: params.update({"speaker": x}), voice, None)
v_pitch.change(lambda x: params.update({"voice_pitch": x}), v_pitch, None)
v_speed.change(lambda x: params.update({"voice_speed": x}), v_speed, None)
v_speed.change(lambda x: params.update({"voice_speed": x}), v_speed, None)