Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,22 +31,60 @@ SAMPLE_RATE = feature_extractor.sampling_rate
|
|
| 31 |
SEED = 42
|
| 32 |
|
| 33 |
default_text = "La voix humaine est un instrument de musique au-dessus de tous les autres."
|
| 34 |
-
default_description = "a woman with a slightly low-pitched voice speaks slowly in a clear and close-sounding environment, but her delivery is quite monotone."
|
| 35 |
examples = [
|
|
|
|
| 36 |
[
|
| 37 |
"La voix humaine est un instrument de musique au-dessus de tous les autres.",
|
| 38 |
-
"a woman with a slightly low-pitched voice speaks slowly in a clear and close-sounding environment, but her delivery is quite monotone.",
|
| 39 |
-
True,
|
| 40 |
None,
|
| 41 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
[
|
| 43 |
"The human voice is nature's most perfect instrument.",
|
| 44 |
-
"
|
| 45 |
-
|
| 46 |
None,
|
| 47 |
],
|
| 48 |
]
|
| 49 |
|
|
|
|
| 50 |
number_normalizer = EnglishNumberNormalizer()
|
| 51 |
|
| 52 |
def format_description(raw_description, do_format=True):
|
|
@@ -184,7 +222,7 @@ high-fidelity text-to-speech (TTS) models.</p>
|
|
| 184 |
value=default_description
|
| 185 |
)
|
| 186 |
do_format = gr.Checkbox(
|
| 187 |
-
label="Reformat description using
|
| 188 |
value=True
|
| 189 |
)
|
| 190 |
formatted_description = gr.Textbox(
|
|
|
|
| 31 |
SEED = 42
|
| 32 |
|
| 33 |
default_text = "La voix humaine est un instrument de musique au-dessus de tous les autres."
|
| 34 |
+
default_description = "a woman with a slightly low- pitched voice speaks slowly in a clear and close- sounding environment, but her delivery is quite monotone."
|
| 35 |
examples = [
|
| 36 |
+
# French
|
| 37 |
[
|
| 38 |
"La voix humaine est un instrument de musique au-dessus de tous les autres.",
|
| 39 |
+
"a woman with a slightly low- pitched voice speaks slowly in a clear and close- sounding environment, but her delivery is quite monotone.",
|
|
|
|
| 40 |
None,
|
| 41 |
],
|
| 42 |
+
# Spanish
|
| 43 |
+
[
|
| 44 |
+
"La voz es el reflejo del alma en el espejo del tiempo.",
|
| 45 |
+
"a man with a moderate pitch voice speaks slowly with a slightly animated delivery in a very close- sounding environment with minimal background noise.",
|
| 46 |
+
None,
|
| 47 |
+
],
|
| 48 |
+
# Italian
|
| 49 |
+
[
|
| 50 |
+
"La voce umana è la più bella musica che esista al mondo.",
|
| 51 |
+
"a man with a moderate pitch speaks slowly in a very noisy environment that sounds very distant, delivering his words in a monotone manner.",
|
| 52 |
+
None,
|
| 53 |
+
],
|
| 54 |
+
# Portuguese
|
| 55 |
+
[
|
| 56 |
+
"A voz é o espelho da alma e o som do coração.",
|
| 57 |
+
"a man speaks slowly in a distant- sounding environment with a clean audio quality, delivering his message in a monotone voice at a moderate pitch. ",
|
| 58 |
+
None,
|
| 59 |
+
],
|
| 60 |
+
# Polish
|
| 61 |
+
[
|
| 62 |
+
"Głos ludzki jest najpiękniejszym instrumentem świata.",
|
| 63 |
+
"a man with a moderate pitch speaks in a monotone manner at a slightly slow pace, but the recording is quite noisy and sounds very distant.",
|
| 64 |
+
None,
|
| 65 |
+
],
|
| 66 |
+
# German
|
| 67 |
+
[
|
| 68 |
+
"Die menschliche Stimme ist das schönste Instrument der Welt.",
|
| 69 |
+
"a man with a moderate pitch speaks slowly in a noisy environment with a flat tone of voice, creating a slightly close- sounding effect.",
|
| 70 |
+
None,
|
| 71 |
+
],
|
| 72 |
+
# Dutch
|
| 73 |
+
[
|
| 74 |
+
"De menselijke stem is het mooiste instrument dat er bestaat.",
|
| 75 |
+
"a man with a moderate pitch speaks slightly slowly with an expressive and animated delivery in a very close- sounding environment with a bit of background noise.",
|
| 76 |
+
None,
|
| 77 |
+
],
|
| 78 |
+
# English
|
| 79 |
[
|
| 80 |
"The human voice is nature's most perfect instrument.",
|
| 81 |
+
"Aa woman with a slightly low- pitched voice speaks slowly in a very distant- sounding environment with a clean audio quality, delivering her message in a very monotone manner.",
|
| 82 |
+
|
| 83 |
None,
|
| 84 |
],
|
| 85 |
]
|
| 86 |
|
| 87 |
+
|
| 88 |
number_normalizer = EnglishNumberNormalizer()
|
| 89 |
|
| 90 |
def format_description(raw_description, do_format=True):
|
|
|
|
| 222 |
value=default_description
|
| 223 |
)
|
| 224 |
do_format = gr.Checkbox(
|
| 225 |
+
label="Reformat description using Gemma 2b",
|
| 226 |
value=True
|
| 227 |
)
|
| 228 |
formatted_description = gr.Textbox(
|