Upload app.py
Browse files
app.py
CHANGED
|
@@ -271,9 +271,8 @@ def clamp_speed(speed):
|
|
| 271 |
|
| 272 |
# Must be backwards compatible with https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
|
| 273 |
def generate(text, voice='af', ps=None, speed=1, trim=3000, use_gpu='auto', sk=None):
|
| 274 |
-
sk = os.environ['SK'] if text in sents else sk
|
| 275 |
ps = ps or phonemize(text, voice)
|
| 276 |
-
if not sk and ps.strip('"') in harvsents:
|
| 277 |
sk = os.environ['SK']
|
| 278 |
if sk not in {os.environ['SK'], os.environ['ARENA']}:
|
| 279 |
return (None, '')
|
|
|
|
| 271 |
|
| 272 |
# Must be backwards compatible with https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
|
| 273 |
def generate(text, voice='af', ps=None, speed=1, trim=3000, use_gpu='auto', sk=None):
|
|
|
|
| 274 |
ps = ps or phonemize(text, voice)
|
| 275 |
+
if not sk and (text in sents or ps.strip('"') in harvsents):
|
| 276 |
sk = os.environ['SK']
|
| 277 |
if sk not in {os.environ['SK'], os.environ['ARENA']}:
|
| 278 |
return (None, '')
|