Spaces:
Sleeping
Sleeping
mrfakename
commited on
Merge branch 'main' of https://huggingface.co/spaces/styletts2/styletts2
Browse files
app.py
CHANGED
@@ -65,16 +65,16 @@ def clsynthesize(text, voice, vcsteps):
|
|
65 |
if text.strip() == "":
|
66 |
raise gr.Error("You must enter some text")
|
67 |
# if global_phonemizer.phonemize([text]) > 300:
|
68 |
-
if len(text) >
|
69 |
-
raise gr.Error("Text must be under
|
70 |
# return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=20, embedding_scale=1))
|
71 |
return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=vcsteps, embedding_scale=1))
|
72 |
def ljsynthesize(text, steps):
|
73 |
if text.strip() == "":
|
74 |
raise gr.Error("You must enter some text")
|
75 |
# if global_phonemizer.phonemize([text]) > 300:
|
76 |
-
if len(text) >
|
77 |
-
raise gr.Error("Text must be under
|
78 |
noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
|
79 |
return (24000, ljspeechimportable.inference(text, noise, diffusion_steps=steps, embedding_scale=1))
|
80 |
|
@@ -83,7 +83,7 @@ with gr.Blocks() as vctk: # just realized it isn't vctk but libritts but i'm too
|
|
83 |
with gr.Row():
|
84 |
with gr.Column(scale=1):
|
85 |
inp = gr.Textbox(label="Text", info="What would you like StyleTTS 2 to read? It works better on full sentences.", interactive=True)
|
86 |
-
voice = gr.Dropdown(voicelist, label="Voice", info="Select a default voice.", value='m-us-
|
87 |
multispeakersteps = gr.Slider(minimum=5, maximum=15, value=7, step=1, label="Diffusion Steps", info="Higher = better quality, but slower", interactive=True)
|
88 |
msexpand = gr.Checkbox(label="Expand acronyms", info="Expand acronyms using SciSpacy algorithm")
|
89 |
# use_gruut = gr.Checkbox(label="Use alternate phonemizer (Gruut) - Experimental")
|
@@ -128,6 +128,8 @@ with gr.Blocks(title="StyleTTS 2", css="footer{display:none !important}", theme=
|
|
128 |
|
129 |
A free demo of StyleTTS 2. **I am not affiliated with the StyleTTS 2 Authors.**
|
130 |
|
|
|
|
|
131 |
**Before using this demo, you agree to inform the listeners that the speech samples are synthesized by the pre-trained models, unless you have the permission to use the voice you synthesize. That is, you agree to only use voices whose speakers grant the permission to have their voice cloned, either directly or by license before making synthesized voices public, or you have to publicly announce that these voices are synthesized if you do not have the permission to use these voices.**
|
132 |
|
133 |
Is there a long queue on this space? Duplicate it and add a more powerful GPU to skip the wait! **Note: Thank you to Hugging Face for their generous GPU grant program!**
|
|
|
65 |
if text.strip() == "":
|
66 |
raise gr.Error("You must enter some text")
|
67 |
# if global_phonemizer.phonemize([text]) > 300:
|
68 |
+
if len(text) > 400:
|
69 |
+
raise gr.Error("Text must be under 400 characters")
|
70 |
# return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=20, embedding_scale=1))
|
71 |
return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=vcsteps, embedding_scale=1))
|
72 |
def ljsynthesize(text, steps):
|
73 |
if text.strip() == "":
|
74 |
raise gr.Error("You must enter some text")
|
75 |
# if global_phonemizer.phonemize([text]) > 300:
|
76 |
+
if len(text) > 400:
|
77 |
+
raise gr.Error("Text must be under 400 characters")
|
78 |
noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
|
79 |
return (24000, ljspeechimportable.inference(text, noise, diffusion_steps=steps, embedding_scale=1))
|
80 |
|
|
|
83 |
with gr.Row():
|
84 |
with gr.Column(scale=1):
|
85 |
inp = gr.Textbox(label="Text", info="What would you like StyleTTS 2 to read? It works better on full sentences.", interactive=True)
|
86 |
+
voice = gr.Dropdown(voicelist, label="Voice", info="Select a default voice.", value='m-us-2', interactive=True)
|
87 |
multispeakersteps = gr.Slider(minimum=5, maximum=15, value=7, step=1, label="Diffusion Steps", info="Higher = better quality, but slower", interactive=True)
|
88 |
msexpand = gr.Checkbox(label="Expand acronyms", info="Expand acronyms using SciSpacy algorithm")
|
89 |
# use_gruut = gr.Checkbox(label="Use alternate phonemizer (Gruut) - Experimental")
|
|
|
128 |
|
129 |
A free demo of StyleTTS 2. **I am not affiliated with the StyleTTS 2 Authors.**
|
130 |
|
131 |
+
#### Help this space get to the top of HF's trending list! Please give this space a Like!
|
132 |
+
|
133 |
**Before using this demo, you agree to inform the listeners that the speech samples are synthesized by the pre-trained models, unless you have the permission to use the voice you synthesize. That is, you agree to only use voices whose speakers grant the permission to have their voice cloned, either directly or by license before making synthesized voices public, or you have to publicly announce that these voices are synthesized if you do not have the permission to use these voices.**
|
134 |
|
135 |
Is there a long queue on this space? Duplicate it and add a more powerful GPU to skip the wait! **Note: Thank you to Hugging Face for their generous GPU grant program!**
|