Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update sdk
Browse files- README.md +1 -1
- app.py +6 -17
- saved_model/13/cover.jpg +2 -2
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: πποΈ
|
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 3.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
|
|
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 3.4
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
app.py
CHANGED
|
@@ -198,14 +198,11 @@ if __name__ == '__main__':
|
|
| 198 |
f"\n\n"
|
| 199 |
f"lang: {lang}")
|
| 200 |
tts_input1 = gr.TextArea(label="Text (60 words limitation)", value=example,
|
| 201 |
-
elem_id="tts-input")
|
| 202 |
tts_input2 = gr.Dropdown(label="Speaker", choices=speakers,
|
| 203 |
type="index", value=speakers[0])
|
| 204 |
tts_input3 = gr.Slider(label="Speed", value=1, minimum=0.5, maximum=2, step=0.1)
|
| 205 |
-
|
| 206 |
-
advanced_options = gr.Column()
|
| 207 |
-
advanced_options.elem_id = "advanced-options"
|
| 208 |
-
with advanced_options:
|
| 209 |
phoneme_input = gr.Checkbox(value=False, label="Phoneme input")
|
| 210 |
to_phoneme_btn = gr.Button("Covert text to phoneme")
|
| 211 |
phoneme_list = gr.Dataset(label="Phoneme list", components=[tts_input1],
|
|
@@ -214,24 +211,16 @@ if __name__ == '__main__':
|
|
| 214 |
tts_submit = gr.Button("Generate", variant="primary")
|
| 215 |
tts_output1 = gr.Textbox(label="Output Message")
|
| 216 |
tts_output2 = gr.Audio(label="Output Audio")
|
| 217 |
-
advanced_button.click(None, [], [], _js="""
|
| 218 |
-
() => {
|
| 219 |
-
let options = document.querySelector("body > gradio-app");
|
| 220 |
-
if (options.shadowRoot != null)
|
| 221 |
-
options = options.shadowRoot;
|
| 222 |
-
options = options.querySelector("#advanced-options");
|
| 223 |
-
options.style.display = ["none", ""].includes(options.style.display) ? "flex" : "none";
|
| 224 |
-
}""")
|
| 225 |
tts_submit.click(tts_fn, [tts_input1, tts_input2, tts_input3, phoneme_input],
|
| 226 |
[tts_output1, tts_output2])
|
| 227 |
to_phoneme_btn.click(to_phoneme_fn, [tts_input1], [tts_input1])
|
| 228 |
phoneme_list.click(None, [phoneme_list, phoneme_list_json], [],
|
| 229 |
-
_js="""
|
| 230 |
-
(i,phonemes) => {
|
| 231 |
let text_input = document.querySelector("body > gradio-app");
|
| 232 |
if (text_input.shadowRoot != null)
|
| 233 |
text_input = text_input.shadowRoot;
|
| 234 |
-
text_input = text_input.querySelector("#tts-input").querySelector("textarea");
|
| 235 |
let startPos = text_input.selectionStart;
|
| 236 |
let endPos = text_input.selectionEnd;
|
| 237 |
let oldTxt = text_input.value;
|
|
@@ -241,7 +230,7 @@ if __name__ == '__main__':
|
|
| 241 |
text_input.selectionStart = startPos + phonemes[i].length;
|
| 242 |
text_input.selectionEnd = startPos + phonemes[i].length;
|
| 243 |
text_input.blur()
|
| 244 |
-
}""")
|
| 245 |
|
| 246 |
with gr.TabItem("Voice Conversion"):
|
| 247 |
with gr.Tabs():
|
|
|
|
| 198 |
f"\n\n"
|
| 199 |
f"lang: {lang}")
|
| 200 |
tts_input1 = gr.TextArea(label="Text (60 words limitation)", value=example,
|
| 201 |
+
elem_id=f"tts-input{i}")
|
| 202 |
tts_input2 = gr.Dropdown(label="Speaker", choices=speakers,
|
| 203 |
type="index", value=speakers[0])
|
| 204 |
tts_input3 = gr.Slider(label="Speed", value=1, minimum=0.5, maximum=2, step=0.1)
|
| 205 |
+
with gr.Accordion(label="Advanced Options", open=False):
|
|
|
|
|
|
|
|
|
|
| 206 |
phoneme_input = gr.Checkbox(value=False, label="Phoneme input")
|
| 207 |
to_phoneme_btn = gr.Button("Covert text to phoneme")
|
| 208 |
phoneme_list = gr.Dataset(label="Phoneme list", components=[tts_input1],
|
|
|
|
| 211 |
tts_submit = gr.Button("Generate", variant="primary")
|
| 212 |
tts_output1 = gr.Textbox(label="Output Message")
|
| 213 |
tts_output2 = gr.Audio(label="Output Audio")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
tts_submit.click(tts_fn, [tts_input1, tts_input2, tts_input3, phoneme_input],
|
| 215 |
[tts_output1, tts_output2])
|
| 216 |
to_phoneme_btn.click(to_phoneme_fn, [tts_input1], [tts_input1])
|
| 217 |
phoneme_list.click(None, [phoneme_list, phoneme_list_json], [],
|
| 218 |
+
_js=f"""
|
| 219 |
+
(i,phonemes) => {{
|
| 220 |
let text_input = document.querySelector("body > gradio-app");
|
| 221 |
if (text_input.shadowRoot != null)
|
| 222 |
text_input = text_input.shadowRoot;
|
| 223 |
+
text_input = text_input.querySelector("#tts-input{i}").querySelector("textarea");
|
| 224 |
let startPos = text_input.selectionStart;
|
| 225 |
let endPos = text_input.selectionEnd;
|
| 226 |
let oldTxt = text_input.value;
|
|
|
|
| 230 |
text_input.selectionStart = startPos + phonemes[i].length;
|
| 231 |
text_input.selectionEnd = startPos + phonemes[i].length;
|
| 232 |
text_input.blur()
|
| 233 |
+
}}""")
|
| 234 |
|
| 235 |
with gr.TabItem("Voice Conversion"):
|
| 236 |
with gr.Tabs():
|
saved_model/13/cover.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|