Spaces:
Running
Running
mrfakename
commited on
Commit
•
1674465
1
Parent(s):
297e7ce
Update app.py
Browse files
app.py
CHANGED
@@ -12,8 +12,8 @@ for v in voicelist:
|
|
12 |
def synthesize(text, voice):
|
13 |
if text.strip() == "":
|
14 |
raise gr.Error("You must enter some text")
|
15 |
-
if len(text) >
|
16 |
-
raise gr.Error("Text must be under
|
17 |
v = voice.lower()
|
18 |
return (24000, styletts2importable.inference(text, voices[v], alpha=0.3, beta=0.7, diffusion_steps=7, embedding_scale=1))
|
19 |
def clsynthesize(text, voice):
|
@@ -21,12 +21,12 @@ def clsynthesize(text, voice):
|
|
21 |
raise gr.Error("You must enter some text")
|
22 |
if len(text) > 500:
|
23 |
raise gr.Error("Text must be under 500 characters")
|
24 |
-
return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=
|
25 |
def ljsynthesize(text):
|
26 |
if text.strip() == "":
|
27 |
raise gr.Error("You must enter some text")
|
28 |
-
if len(text) >
|
29 |
-
raise gr.Error("Text must be under
|
30 |
noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
|
31 |
return (24000, ljspeechimportable.inference(text, noise, diffusion_steps=7, embedding_scale=1))
|
32 |
|
|
|
12 |
def synthesize(text, voice):
|
13 |
if text.strip() == "":
|
14 |
raise gr.Error("You must enter some text")
|
15 |
+
if len(text) > 1500:
|
16 |
+
raise gr.Error("Text must be under 1500 characters")
|
17 |
v = voice.lower()
|
18 |
return (24000, styletts2importable.inference(text, voices[v], alpha=0.3, beta=0.7, diffusion_steps=7, embedding_scale=1))
|
19 |
def clsynthesize(text, voice):
|
|
|
21 |
raise gr.Error("You must enter some text")
|
22 |
if len(text) > 500:
|
23 |
raise gr.Error("Text must be under 500 characters")
|
24 |
+
return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=20, embedding_scale=1))
|
25 |
def ljsynthesize(text):
|
26 |
if text.strip() == "":
|
27 |
raise gr.Error("You must enter some text")
|
28 |
+
if len(text) > 1500:
|
29 |
+
raise gr.Error("Text must be under 1500 characters")
|
30 |
noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
|
31 |
return (24000, ljspeechimportable.inference(text, noise, diffusion_steps=7, embedding_scale=1))
|
32 |
|