Spaces:
Runtime error
Runtime error
ahnafsamin
commited on
Commit
•
3fbf8ed
0
Parent(s):
Duplicate from ahnafsamin/GroTTS-FastSpeech2
Browse files- .gitattributes +27 -0
- README.md +14 -0
- app.py +42 -0
- packages.txt +2 -0
- requirements.txt +7 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
19 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: GroTTS FastSpeech2
|
3 |
+
emoji: 📚
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: pink
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.0.24
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
license: afl-3.0
|
11 |
+
duplicated_from: ahnafsamin/GroTTS-FastSpeech2
|
12 |
+
---
|
13 |
+
|
14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
os.environ["CURL_CA_BUNDLE"]=""
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
import time
|
7 |
+
import urllib.request
|
8 |
+
from pathlib import Path
|
9 |
+
import os
|
10 |
+
import torch
|
11 |
+
import scipy.io.wavfile
|
12 |
+
from espnet2.bin.tts_inference import Text2Speech
|
13 |
+
from espnet2.utils.types import str_or_none
|
14 |
+
from parallel_wavegan.utils import download_pretrained_model
|
15 |
+
|
16 |
+
|
17 |
+
gos_text2speech = Text2Speech.from_pretrained(
|
18 |
+
model_tag="https://huggingface.co/ahnafsamin/FastSpeech2-gronings/resolve/main/tts_train_fastspeech2_raw_char_tacotron_train.loss.ave.zip",
|
19 |
+
vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
|
20 |
+
)
|
21 |
+
|
22 |
+
def inference(text,lang):
|
23 |
+
with torch.no_grad():
|
24 |
+
if lang == "gronings":
|
25 |
+
wav = gos_text2speech(text)["wav"]
|
26 |
+
scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
|
27 |
+
|
28 |
+
return "out.wav", "out.wav"
|
29 |
+
|
30 |
+
title = "GroTTS"
|
31 |
+
examples = [
|
32 |
+
['Ze gingen mit klas noar waddendiek, over en deur bragel lopen.', 'gronings']
|
33 |
+
]
|
34 |
+
|
35 |
+
|
36 |
+
gr.Interface(
|
37 |
+
inference,
|
38 |
+
[gr.inputs.Textbox(label="input text", lines=3), gr.inputs.Radio(choices=["gronings"], type="value", default="gronings", label="language")],
|
39 |
+
[gr.outputs.Audio(type="file", label="Output"), gr.outputs.File()],
|
40 |
+
title=title,
|
41 |
+
examples=examples
|
42 |
+
).launch(enable_queue=True)
|
packages.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
cmake
|
2 |
+
libsndfile1
|
requirements.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
espnet==0.10.3
|
2 |
+
pyopenjtalk==0.1.5
|
3 |
+
parallel_wavegan==0.5.3
|
4 |
+
espnet_model_zoo
|
5 |
+
scipy
|
6 |
+
torch
|
7 |
+
numpy==1.23.1
|