Upload app.py
Browse files
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 |
-
|
| 216 |
-
|
| 217 |
-
|
|
|
|
| 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)
|