hexgrad commited on
Commit
15b414e
·
verified ·
1 Parent(s): 370a852

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -211,10 +211,11 @@ def forward_gpu(tokens, voice, speed):
211
  return forward(tokens, voice, speed, device='cuda')
212
 
213
  # Must be backwards compatible with https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
214
- def generate(*args):
215
- text, voice, ps, speed = args[:4]
216
- trim = args[4] if len(args) > 4 and isinstance(args[4], int) else 4000
217
- use_gpu = args[5] if len(args) > 5 and args[5] in ('auto', False, True) else 'auto'
 
218
  if voice not in VOICES['cpu']:
219
  voice = 'af'
220
  ps = ps or phonemize(text, voice)
 
211
  return forward(tokens, voice, speed, device='cuda')
212
 
213
  # Must be backwards compatible with https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
214
+ def generate(text, voice, ps, speed, trim, use_gpu, *args):
215
+ if not isinstance(trim, int):
216
+ trim = 4000
217
+ if use_gpu not in ('auto', False, True):
218
+ use_gpu = 'auto'
219
  if voice not in VOICES['cpu']:
220
  voice = 'af'
221
  ps = ps or phonemize(text, voice)