Spaces:
Build error
Build error
Sonu Sharma
commited on
Commit
·
ea9036c
1
Parent(s):
423f423
Upload 3 files
Browse files- .gitattributes +1 -0
- app.py +41 -0
- requirements.txt +2 -0
- tts_output.wav +3 -0
.gitattributes
CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
tts_output.wav filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from subprocess import call
|
2 |
+
import gradio as gr
|
3 |
+
import os
|
4 |
+
|
5 |
+
|
6 |
+
def run_cmd(command):
|
7 |
+
try:
|
8 |
+
print(command)
|
9 |
+
call(command)
|
10 |
+
except KeyboardInterrupt:
|
11 |
+
print("Process interrupted")
|
12 |
+
sys.exit(1)
|
13 |
+
|
14 |
+
|
15 |
+
def inference(text):
|
16 |
+
cmd = ['tts', '--text', text]
|
17 |
+
run_cmd(cmd)
|
18 |
+
return 'tts_output.wav'
|
19 |
+
|
20 |
+
|
21 |
+
inputs = gr.inputs.Textbox(lines=5, label="Input Text")
|
22 |
+
outputs = gr.outputs.Audio(type="filepath", label="Output Audio")
|
23 |
+
title = "Text To Speech"
|
24 |
+
description = "An example of using TTS to generate speech from text."
|
25 |
+
article = ""
|
26 |
+
examples = [
|
27 |
+
["This is an open-source library that generates synthetic speech!=1"]
|
28 |
+
]
|
29 |
+
gr.Interface(
|
30 |
+
inference,
|
31 |
+
inputs,
|
32 |
+
outputs,
|
33 |
+
verbose=True,
|
34 |
+
title=title,
|
35 |
+
description=description,
|
36 |
+
article=article,
|
37 |
+
examples=examples,
|
38 |
+
enable_queue=True,
|
39 |
+
allow_flagging="never",
|
40 |
+
|
41 |
+
).launch(debug=True)
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
TTS
|
2 |
+
gradio
|
tts_output.wav
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1b5ca414fb01823c7e62c09eb4d0dccfe9775023a658239e698d368881a25f7a
|
3 |
+
size 5128268
|