Spaces:
Running
on
Zero
Running
on
Zero
minor
Browse files
README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
colorFrom: blue
|
4 |
colorTo: blue
|
5 |
sdk: gradio
|
6 |
emoji: 🗣️
|
7 |
license: mit
|
8 |
app_file: app.py
|
9 |
-
pinned:
|
10 |
short_description: Fast, efficient, & multilingual text-to-speech
|
11 |
---
|
|
|
1 |
---
|
2 |
+
title: Podcastify
|
3 |
colorFrom: blue
|
4 |
colorTo: blue
|
5 |
sdk: gradio
|
6 |
emoji: 🗣️
|
7 |
license: mit
|
8 |
app_file: app.py
|
9 |
+
pinned: true
|
10 |
short_description: Fast, efficient, & multilingual text-to-speech
|
11 |
---
|
app.py
CHANGED
@@ -10,11 +10,12 @@ import tempfile
|
|
10 |
def synthesize(text, speed, progress=gr.Progress()):
|
11 |
speed = 1.0
|
12 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
13 |
-
|
14 |
-
|
|
|
15 |
speakers=['EN-US','EN-Default']
|
16 |
bio = io.BytesIO()
|
17 |
-
models[language].tts_to_file(text,
|
18 |
return bio.getvalue()
|
19 |
|
20 |
|
|
|
10 |
def synthesize(text, speed, progress=gr.Progress()):
|
11 |
speed = 1.0
|
12 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
13 |
+
models = {
|
14 |
+
'EN': TTS(language='EN', device=device),
|
15 |
+
}
|
16 |
speakers=['EN-US','EN-Default']
|
17 |
bio = io.BytesIO()
|
18 |
+
models[language].tts_to_file(text, models['EN'].hps.data.spk2id[speakers[0]], bio, speed=speed, pbar=progress.tqdm, format='wav')
|
19 |
return bio.getvalue()
|
20 |
|
21 |
|