Spaces:
Runtime error
Runtime error
Danijel Petkovic
commited on
Commit
•
9ee93b6
1
Parent(s):
3beb0e3
Try
Browse files
app.py
CHANGED
@@ -102,24 +102,25 @@ if question:
|
|
102 |
unsafe_allow_html=True
|
103 |
)
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
102 |
unsafe_allow_html=True
|
103 |
)
|
104 |
|
105 |
+
if generated_answer:
|
106 |
+
with st.spinner("Generating an audio..."):
|
107 |
+
audio_file = query_audio_tts({
|
108 |
+
"inputs": generated_answer,
|
109 |
+
"parameters": {
|
110 |
+
"vocoder_tag": "str_or_none(none)",
|
111 |
+
"threshold": 0.5,
|
112 |
+
"minlenratio": 0.0,
|
113 |
+
"maxlenratio": 10.0,
|
114 |
+
"use_att_constraint": False,
|
115 |
+
"backward_window": 1,
|
116 |
+
"forward_window": 3,
|
117 |
+
"speed_control_alpha": 1.0,
|
118 |
+
"noise_scale": 0.333,
|
119 |
+
"noise_scale_dur": 0.333
|
120 |
+
}
|
121 |
+
})
|
122 |
|
123 |
+
with open("out.flac", "wb") as f:
|
124 |
+
f.write(audio_file)
|
125 |
+
|
126 |
+
st.audio("out.flac")
|