Save language option
Browse files
app.py
CHANGED
@@ -189,6 +189,7 @@ def predict_on_gpu(
|
|
189 |
)
|
190 |
|
191 |
with gr.Blocks() as interface:
|
|
|
192 |
gr.HTML(
|
193 |
"""
|
194 |
<h1><center>XTTS</center></h1>
|
@@ -229,15 +230,14 @@ Leave a star on the Github <a href="https://github.com/coqui-ai/TTS">TTS</a>, wh
|
|
229 |
["๐ฌ๐ง English", "en"],
|
230 |
["๐ซ๐ท French", "fr"],
|
231 |
["๐ฉ๐ช German", "de"],
|
232 |
-
["๐ญ๐บ Hungarian", "hu"],
|
233 |
["๐ฎ๐น Italian", "it"],
|
234 |
["๐ต๐ฑ Polish", "pl"],
|
235 |
["๐ท๐บ Russian", "ru"],
|
236 |
["๐ช๐ธ Spanish", "es"],
|
237 |
-
["๐น๐ท Turkish", "tr"]
|
|
|
238 |
],
|
239 |
max_choices=1,
|
240 |
-
value="en",
|
241 |
elem_id = "language-id",
|
242 |
)
|
243 |
gr.HTML("More languages <a href='https://huggingface.co/spaces/Brasd99/TTS-Voice-Cloner'>here</a>")
|
@@ -378,6 +378,12 @@ You can install _Pinokio_ locally and then install _XTTS_ into it. It should be
|
|
378 |
You can also install XTTS on your computer using docker but it's more complicate.
|
379 |
""")
|
380 |
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
submit.click(fn = update_output, inputs = [
|
382 |
generation_number
|
383 |
], outputs = [
|
@@ -518,4 +524,13 @@ You can also install XTTS on your computer using docker but it's more complicate
|
|
518 |
information
|
519 |
], scroll_to_output = True)
|
520 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
521 |
interface.queue(max_size = 5).launch(debug=True)
|
|
|
189 |
)
|
190 |
|
191 |
with gr.Blocks() as interface:
|
192 |
+
local_storage = gr.BrowserState("en")
|
193 |
gr.HTML(
|
194 |
"""
|
195 |
<h1><center>XTTS</center></h1>
|
|
|
230 |
["๐ฌ๐ง English", "en"],
|
231 |
["๐ซ๐ท French", "fr"],
|
232 |
["๐ฉ๐ช German", "de"],
|
|
|
233 |
["๐ฎ๐น Italian", "it"],
|
234 |
["๐ต๐ฑ Polish", "pl"],
|
235 |
["๐ท๐บ Russian", "ru"],
|
236 |
["๐ช๐ธ Spanish", "es"],
|
237 |
+
["๐น๐ท Turkish", "tr"],
|
238 |
+
["๐ญ๐บ Hungarian", "hu"]
|
239 |
],
|
240 |
max_choices=1,
|
|
|
241 |
elem_id = "language-id",
|
242 |
)
|
243 |
gr.HTML("More languages <a href='https://huggingface.co/spaces/Brasd99/TTS-Voice-Cloner'>here</a>")
|
|
|
378 |
You can also install XTTS on your computer using docker but it's more complicate.
|
379 |
""")
|
380 |
|
381 |
+
language.change(lambda language: language, inputs = [
|
382 |
+
language
|
383 |
+
], outputs = [
|
384 |
+
local_storage
|
385 |
+
])
|
386 |
+
|
387 |
submit.click(fn = update_output, inputs = [
|
388 |
generation_number
|
389 |
], outputs = [
|
|
|
524 |
information
|
525 |
], scroll_to_output = True)
|
526 |
|
527 |
+
# Load saved preferences when the page loads
|
528 |
+
interface.load(
|
529 |
+
fn=lambda language: language, inputs = [
|
530 |
+
local_storage
|
531 |
+
], outputs = [
|
532 |
+
language
|
533 |
+
]
|
534 |
+
)
|
535 |
+
|
536 |
interface.queue(max_size = 5).launch(debug=True)
|