hexgrad commited on
Commit
1a55ad7
·
verified ·
1 Parent(s): 051bd38

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -290,11 +290,9 @@ def trim_if_needed(out, trim):
290
  # Must be backwards compatible with https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
291
  def generate(text, voice='af', ps=None, speed=1, trim=0.5, use_gpu='auto', sk=None):
292
  ps = ps or phonemize(text, voice)
293
- if not sk and (text in sents or ps.strip('"') in harvsents):
294
- sk = os.environ['SK']
295
  if sk not in {os.environ['SK'], os.environ['ARENA']}:
296
- print('❌', datetime.now(), text, voice, use_gpu, sk)
297
- return (None, '')
298
  voices = resolve_voices(voice, warn=ps)
299
  speed = clamp_speed(speed)
300
  trim = clamp_trim(trim)
 
290
  # Must be backwards compatible with https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
291
  def generate(text, voice='af', ps=None, speed=1, trim=0.5, use_gpu='auto', sk=None):
292
  ps = ps or phonemize(text, voice)
 
 
293
  if sk not in {os.environ['SK'], os.environ['ARENA']}:
294
+ assert text in sents or ps.strip('"') in harvsents, ('❌', datetime.now(), text, voice, use_gpu, sk)
295
+ sk = os.environ['SK']
296
  voices = resolve_voices(voice, warn=ps)
297
  speed = clamp_speed(speed)
298
  trim = clamp_trim(trim)