Spaces:
Sleeping
Sleeping
speed change
Browse files
app.py
CHANGED
|
@@ -7,11 +7,10 @@ os.system('python -m unidic download')
|
|
| 7 |
from melo.api import TTS
|
| 8 |
import tempfile
|
| 9 |
import wave
|
| 10 |
-
from pydub import AudioSegment
|
| 11 |
-
|
| 12 |
|
| 13 |
@spaces.GPU
|
| 14 |
-
def synthesize(conversation_text,
|
|
|
|
| 15 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 16 |
models = {
|
| 17 |
'EN': TTS(language='EN', device=device),
|
|
@@ -34,7 +33,7 @@ def synthesize(conversation_text, speed, progress=gr.Progress()):
|
|
| 34 |
combined_audio.export(final_audio_path, format='mp3')
|
| 35 |
return final_audio_path
|
| 36 |
|
| 37 |
-
|
| 38 |
with gr.Blocks() as demo:
|
| 39 |
gr.Markdown('# Turn Any Article into Podcast')
|
| 40 |
gr.Markdown('## Easily convert articles from URLs into listenable audio Podcast.')
|
|
|
|
| 7 |
from melo.api import TTS
|
| 8 |
import tempfile
|
| 9 |
import wave
|
|
|
|
|
|
|
| 10 |
|
| 11 |
@spaces.GPU
|
| 12 |
+
def synthesize(conversation_text, progress=gr.Progress()):
|
| 13 |
+
speed=1.0
|
| 14 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 15 |
models = {
|
| 16 |
'EN': TTS(language='EN', device=device),
|
|
|
|
| 33 |
combined_audio.export(final_audio_path, format='mp3')
|
| 34 |
return final_audio_path
|
| 35 |
|
| 36 |
+
|
| 37 |
with gr.Blocks() as demo:
|
| 38 |
gr.Markdown('# Turn Any Article into Podcast')
|
| 39 |
gr.Markdown('## Easily convert articles from URLs into listenable audio Podcast.')
|