Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
|
@@ -55,6 +55,7 @@ def generate_all(text, voice='af_heart', speed=1, use_gpu=CUDA_AVAILABLE):
|
|
| 55 |
pipeline = pipelines[voice[0]]
|
| 56 |
pack = pipeline.load_voice(voice)
|
| 57 |
use_gpu = use_gpu and CUDA_AVAILABLE
|
|
|
|
| 58 |
for _, ps, _ in pipeline(text, voice, speed):
|
| 59 |
ref_s = pack[len(ps)-1]
|
| 60 |
try:
|
|
@@ -70,7 +71,9 @@ def generate_all(text, voice='af_heart', speed=1, use_gpu=CUDA_AVAILABLE):
|
|
| 70 |
else:
|
| 71 |
raise gr.Error(e)
|
| 72 |
yield 24000, audio.numpy()
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
|
| 75 |
with open('en.txt', 'r') as r:
|
| 76 |
random_quotes = [line.strip() for line in r]
|
|
|
|
| 55 |
pipeline = pipelines[voice[0]]
|
| 56 |
pack = pipeline.load_voice(voice)
|
| 57 |
use_gpu = use_gpu and CUDA_AVAILABLE
|
| 58 |
+
first = True
|
| 59 |
for _, ps, _ in pipeline(text, voice, speed):
|
| 60 |
ref_s = pack[len(ps)-1]
|
| 61 |
try:
|
|
|
|
| 71 |
else:
|
| 72 |
raise gr.Error(e)
|
| 73 |
yield 24000, audio.numpy()
|
| 74 |
+
if first:
|
| 75 |
+
first = False
|
| 76 |
+
yield 24000, torch.zeros(1).numpy()
|
| 77 |
|
| 78 |
with open('en.txt', 'r') as r:
|
| 79 |
random_quotes = [line.strip() for line in r]
|