Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,24 @@ def prepare_default_embedding(example):
|
|
45 |
|
46 |
default_embedding = prepare_default_embedding(default_example)
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
def number_to_words(number):
|
50 |
if number < 20:
|
@@ -115,13 +133,13 @@ def text_to_speech(text, audio_file=None):
|
|
115 |
iface = gr.Interface(
|
116 |
fn=text_to_speech,
|
117 |
inputs=[
|
118 |
-
gr.Textbox(label="Enter
|
119 |
],
|
120 |
outputs=[
|
121 |
gr.Audio(label="Generated Speech", type="numpy")
|
122 |
],
|
123 |
-
title="
|
124 |
-
description="Enter
|
125 |
)
|
126 |
|
127 |
-
iface.launch(share=True)
|
|
|
45 |
|
46 |
default_embedding = prepare_default_embedding(default_example)
|
47 |
|
48 |
+
replacements = [
|
49 |
+
("â", "a"), # Long a
|
50 |
+
("ç", "ch"), # Ch as in "chair"
|
51 |
+
("ğ", "gh"), # Silent g or slight elongation of the preceding vowel
|
52 |
+
("ı", "i"), # Dotless i
|
53 |
+
("î", "i"), # Long i
|
54 |
+
("ö", "oe"), # Similar to German ö
|
55 |
+
("ş", "sh"), # Sh as in "shoe"
|
56 |
+
("ü", "ue"), # Similar to German ü
|
57 |
+
("û", "u"), # Long u
|
58 |
+
]
|
59 |
+
|
60 |
+
number_words = {
|
61 |
+
0: "sıfır", 1: "bir", 2: "iki", 3: "üç", 4: "dört", 5: "beş", 6: "altı", 7: "yedi", 8: "sekiz", 9: "dokuz",
|
62 |
+
10: "on", 11: "on bir", 12: "on iki", 13: "on üç", 14: "on dört", 15: "on beş", 16: "on altı", 17: "on yedi",
|
63 |
+
18: "on sekiz", 19: "on dokuz", 20: "yirmi", 30: "otuz", 40: "kırk", 50: "elli", 60: "altmış", 70: "yetmiş",
|
64 |
+
80: "seksen", 90: "doksan", 100: "yüz", 1000: "bin"
|
65 |
+
}
|
66 |
|
67 |
def number_to_words(number):
|
68 |
if number < 20:
|
|
|
133 |
iface = gr.Interface(
|
134 |
fn=text_to_speech,
|
135 |
inputs=[
|
136 |
+
gr.Textbox(label="Enter Turkish text to convert to speech")
|
137 |
],
|
138 |
outputs=[
|
139 |
gr.Audio(label="Generated Speech", type="numpy")
|
140 |
],
|
141 |
+
title="Turkish SpeechT5 Text-to-Speech Demo",
|
142 |
+
description="Enter Turkish text, and listen to the generated speech."
|
143 |
)
|
144 |
|
145 |
+
iface.launch(share=True)
|