Spaces:
Sleeping
Sleeping
mrfakename
commited on
Commit
•
78dd030
1
Parent(s):
62bc974
Update app.py
Browse files
app.py
CHANGED
@@ -24,8 +24,8 @@ def synthesize(text, voice, multispeakersteps):
|
|
24 |
if text.strip() == "":
|
25 |
raise gr.Error("You must enter some text")
|
26 |
# if len(global_phonemizer.phonemize([text])) > 300:
|
27 |
-
if len(text) >
|
28 |
-
raise gr.Error("Text must be under
|
29 |
v = voice.lower()
|
30 |
# return (24000, styletts2importable.inference(text, voices[v], alpha=0.3, beta=0.7, diffusion_steps=7, embedding_scale=1))
|
31 |
return (24000, styletts2importable.inference(text, voices[v], alpha=0.3, beta=0.7, diffusion_steps=multispeakersteps, embedding_scale=1))
|
@@ -49,16 +49,16 @@ def clsynthesize(text, voice, vcsteps):
|
|
49 |
if text.strip() == "":
|
50 |
raise gr.Error("You must enter some text")
|
51 |
# if global_phonemizer.phonemize([text]) > 300:
|
52 |
-
if len(text) >
|
53 |
-
raise gr.Error("Text must be under
|
54 |
# return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=20, embedding_scale=1))
|
55 |
return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=vcsteps, embedding_scale=1))
|
56 |
def ljsynthesize(text):
|
57 |
if text.strip() == "":
|
58 |
raise gr.Error("You must enter some text")
|
59 |
# if global_phonemizer.phonemize([text]) > 300:
|
60 |
-
if len(text) >
|
61 |
-
raise gr.Error("Text must be under
|
62 |
noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
|
63 |
return (24000, ljspeechimportable.inference(text, noise, diffusion_steps=7, embedding_scale=1))
|
64 |
|
|
|
24 |
if text.strip() == "":
|
25 |
raise gr.Error("You must enter some text")
|
26 |
# if len(global_phonemizer.phonemize([text])) > 300:
|
27 |
+
if len(text) > 400:
|
28 |
+
raise gr.Error("Text must be under 400 characters")
|
29 |
v = voice.lower()
|
30 |
# return (24000, styletts2importable.inference(text, voices[v], alpha=0.3, beta=0.7, diffusion_steps=7, embedding_scale=1))
|
31 |
return (24000, styletts2importable.inference(text, voices[v], alpha=0.3, beta=0.7, diffusion_steps=multispeakersteps, embedding_scale=1))
|
|
|
49 |
if text.strip() == "":
|
50 |
raise gr.Error("You must enter some text")
|
51 |
# if global_phonemizer.phonemize([text]) > 300:
|
52 |
+
if len(text) > 400:
|
53 |
+
raise gr.Error("Text must be under 400 characters")
|
54 |
# return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=20, embedding_scale=1))
|
55 |
return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=vcsteps, embedding_scale=1))
|
56 |
def ljsynthesize(text):
|
57 |
if text.strip() == "":
|
58 |
raise gr.Error("You must enter some text")
|
59 |
# if global_phonemizer.phonemize([text]) > 300:
|
60 |
+
if len(text) > 400:
|
61 |
+
raise gr.Error("Text must be under 400 characters")
|
62 |
noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
|
63 |
return (24000, ljspeechimportable.inference(text, noise, diffusion_steps=7, embedding_scale=1))
|
64 |
|