rutsam commited on
Commit
e783a27
β€’
1 Parent(s): dee3a3d

deploy tts

Browse files
Files changed (4) hide show
  1. README.md +1 -1
  2. app.py +33 -0
  3. packages.txt +2 -0
  4. requirements.txt +1 -0
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🌍
4
  colorFrom: gray
5
  colorTo: blue
6
  sdk: gradio
7
- sdk_version: 3.19.1
8
  app_file: app.py
9
  pinned: false
10
  ---
 
4
  colorFrom: gray
5
  colorTo: blue
6
  sdk: gradio
7
+ sdk_version: 3.17.0
8
  app_file: app.py
9
  pinned: false
10
  ---
app.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from espnet2.bin.tts_inference import Text2Speech
2
+ import soundfile as sf
3
+ import gradio as gr
4
+ import subprocess
5
+
6
+ subprocess.check_output("git lfs install", shell=True)
7
+ subprocess.check_output("git clone https://huggingface.co/DigitalUmuganda/lingala_vits_tts",
8
+ shell=True)
9
+
10
+ def generate_audio(text):
11
+ text2speech = Text2Speech(train_config="config.yaml",model_file="train.total_count.best.pth")
12
+ wav = text2speech(text)["wav"]
13
+ sf.write("outfile.wav", wav.numpy(), text2speech.fs, "PCM_16")
14
+ return "outfile.wav"
15
+
16
+
17
+
18
+ iface = gr.Interface(
19
+ fn=generate_audio,
20
+ inputs=[
21
+ gr.inputs.Textbox(
22
+ label="Entrez le text",
23
+ ),
24
+ ],
25
+ outputs=gr.outputs.Audio(type="filepath",label="Output"),
26
+ #outputs=gr.outputs.Textbox(label="Recognized speech from speechbrain model"),
27
+ title="Lingala TTS",
28
+ description="Logiciel capable de creer de son a partir de texte en Lingala",
29
+ layout="vertical",
30
+ live=False
31
+ )
32
+ iface.launch(share=False)
33
+
packages.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ cmake
2
+ libsndfile1
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ espnet