mrfakename commited on
Commit
77cc02b
1 Parent(s): 6cdd8f9
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -23,7 +23,8 @@ for v in voicelist:
23
  def synthesize(text, voice):
24
  if text.strip() == "":
25
  raise gr.Error("You must enter some text")
26
- if len(global_phonemizer.phonemize([text])) > 300:
 
27
  raise gr.Error("Text must be under 300 characters")
28
  v = voice.lower()
29
  return (24000, styletts2importable.inference(text, voices[v], alpha=0.3, beta=0.7, diffusion_steps=7, embedding_scale=1))
@@ -42,13 +43,15 @@ def longsynthesize(text, voice, password, progress=gr.Progress()):
42
  def clsynthesize(text, voice):
43
  if text.strip() == "":
44
  raise gr.Error("You must enter some text")
45
- if global_phonemizer.phonemize([text]) > 300:
 
46
  raise gr.Error("Text must be under 300 characters")
47
  return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=20, embedding_scale=1))
48
  def ljsynthesize(text):
49
  if text.strip() == "":
50
  raise gr.Error("You must enter some text")
51
- if global_phonemizer.phonemize([text]) > 300:
 
52
  raise gr.Error("Text must be under 300 characters")
53
  noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
54
  return (24000, ljspeechimportable.inference(text, noise, diffusion_steps=7, embedding_scale=1))
 
23
  def synthesize(text, voice):
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) > 300:
28
  raise gr.Error("Text must be under 300 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))
 
43
  def clsynthesize(text, voice):
44
  if text.strip() == "":
45
  raise gr.Error("You must enter some text")
46
+ # if global_phonemizer.phonemize([text]) > 300:
47
+ if len(text) > 300:
48
  raise gr.Error("Text must be under 300 characters")
49
  return (24000, styletts2importable.inference(text, styletts2importable.compute_style(voice), alpha=0.3, beta=0.7, diffusion_steps=20, embedding_scale=1))
50
  def ljsynthesize(text):
51
  if text.strip() == "":
52
  raise gr.Error("You must enter some text")
53
+ # if global_phonemizer.phonemize([text]) > 300:
54
+ if len(text) > 300:
55
  raise gr.Error("Text must be under 300 characters")
56
  noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
57
  return (24000, ljspeechimportable.inference(text, noise, diffusion_steps=7, embedding_scale=1))