Update app.py
Browse files
app.py
CHANGED
@@ -42,20 +42,107 @@ headers = {'Authorization': os.environ['DeepL_API_KEY']}
|
|
42 |
whisper_models = ["base", "small", "medium", "base.en"]
|
43 |
|
44 |
|
45 |
-
|
46 |
-
"
|
|
|
|
|
47 |
"Asturian ":"st",
|
|
|
|
|
48 |
"Belarusian":"be",
|
49 |
"Bulgarian":"bg",
|
|
|
|
|
|
|
|
|
|
|
50 |
"Czech":"cs",
|
|
|
51 |
"Danish":"da",
|
52 |
"German":"de",
|
53 |
"Greeek":"el",
|
54 |
"English":"en",
|
|
|
55 |
"Estonian":"et",
|
|
|
|
|
56 |
"Finnish":"fi",
|
57 |
-
"
|
58 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
"Let the model analyze": "Let the model analyze"
|
60 |
}
|
61 |
|
@@ -336,7 +423,8 @@ with demo:
|
|
336 |
with gr.Column():
|
337 |
gr.Markdown('''
|
338 |
##### Here you can start the transcription and translation process.
|
339 |
-
##### Be aware that processing will last some time. With base model it is around 3x speed
|
|
|
340 |
''')
|
341 |
selected_source_lang.render()
|
342 |
selected_whisper_model.render()
|
@@ -356,8 +444,9 @@ with demo:
|
|
356 |
with gr.Row():
|
357 |
with gr.Column():
|
358 |
gr.Markdown('''
|
359 |
-
#####
|
360 |
-
#####
|
|
|
361 |
##### ''')
|
362 |
selected_translation_lang_2.render()
|
363 |
translate_transcriptions_button = gr.Button("Step 3. Translate transcription")
|
|
|
42 |
whisper_models = ["base", "small", "medium", "base.en"]
|
43 |
|
44 |
|
45 |
+
{
|
46 |
+
"Afrikaans":"af",
|
47 |
+
"Amharic":"am",
|
48 |
+
"Arabic":"ar",
|
49 |
"Asturian ":"st",
|
50 |
+
"Azerbaijani":"az",
|
51 |
+
"Bashkir":"ba",
|
52 |
"Belarusian":"be",
|
53 |
"Bulgarian":"bg",
|
54 |
+
"Bengali":"bn",
|
55 |
+
"Breton":"br",
|
56 |
+
"Bosnian":"bs",
|
57 |
+
"Catalan; Valencian":"ca",
|
58 |
+
"Cebuano":"eb",
|
59 |
"Czech":"cs",
|
60 |
+
"Welsh":"cy",
|
61 |
"Danish":"da",
|
62 |
"German":"de",
|
63 |
"Greeek":"el",
|
64 |
"English":"en",
|
65 |
+
"Spanish":"es",
|
66 |
"Estonian":"et",
|
67 |
+
"Persian":"fa",
|
68 |
+
"Fulah":"ff",
|
69 |
"Finnish":"fi",
|
70 |
+
"French":"fr",
|
71 |
+
"Western Frisian":"fy",
|
72 |
+
"Irish":"ga",
|
73 |
+
"Gaelic; Scottish Gaelic":"gd",
|
74 |
+
"Galician":"gl",
|
75 |
+
"Gujarati":"gu",
|
76 |
+
"Hausa":"ha",
|
77 |
+
"Hebrew":"he",
|
78 |
+
"Hindi":"hi",
|
79 |
+
"Croatian":"hr",
|
80 |
+
"Haitian; Haitian Creole":"ht",
|
81 |
+
"Hungarian":"hu",
|
82 |
+
"Armenian":"hy",
|
83 |
+
"Indonesian":"id",
|
84 |
+
"Igbo":"ig",
|
85 |
+
"Iloko":"lo",
|
86 |
+
"Icelandic":"is",
|
87 |
+
"Italian":"it",
|
88 |
+
"Japanese":"ja",
|
89 |
+
"Javanese":"jv",
|
90 |
+
"Georgian":"ka",
|
91 |
+
"Kazakh":"kk",
|
92 |
+
"Central Khmer":"km",
|
93 |
+
"Kannada":"kn",
|
94 |
+
"Korean":"ko",
|
95 |
+
"Luxembourgish; Letzeburgesch":"lb",
|
96 |
+
"Ganda":"lg",
|
97 |
+
"Lingala":"ln",
|
98 |
+
"Lao":"lo",
|
99 |
+
"Lithuanian":"lt",
|
100 |
+
"Latvian":"lv",
|
101 |
+
"Malagasy":"mg",
|
102 |
+
"Macedonian":"mk",
|
103 |
+
"Malayalam":"ml",
|
104 |
+
"Mongolian":"mn",
|
105 |
+
"Marathi":"mr",
|
106 |
+
"Malay":"ms",
|
107 |
+
"Burmese":"my",
|
108 |
+
"Nepali":"ne",
|
109 |
+
"Dutch; Flemish":"nl",
|
110 |
+
"Norwegian":"no",
|
111 |
+
"Northern Sotho":"ns",
|
112 |
+
"Occitan (post 1500)":"oc",
|
113 |
+
"Oriya":"or",
|
114 |
+
"Panjabi; Punjabi":"pa",
|
115 |
+
"Polish":"pl",
|
116 |
+
"Pushto; Pashto":"ps",
|
117 |
+
"Portuguese":"pt",
|
118 |
+
"Romanian; Moldavian; Moldovan":"ro",
|
119 |
+
"Russian":"ru",
|
120 |
+
"Sindhi":"sd",
|
121 |
+
"Sinhala; Sinhalese":"si",
|
122 |
+
"Slovak":"sk",
|
123 |
+
"Slovenian":"sl",
|
124 |
+
"Somali":"so",
|
125 |
+
"Albanian":"sq",
|
126 |
+
"Serbian":"sr",
|
127 |
+
"Swati":"ss",
|
128 |
+
"Sundanese":"su",
|
129 |
+
"Swedish":"sv",
|
130 |
+
"Swahili":"sw",
|
131 |
+
"Tamil":"ta",
|
132 |
+
"Thai":"th",
|
133 |
+
"Tagalog":"tl",
|
134 |
+
"Tswana":"tn",
|
135 |
+
"Turkish":"tr",
|
136 |
+
"Ukrainian":"uk",
|
137 |
+
"Urdu":"ur",
|
138 |
+
"Uzbek":"uz",
|
139 |
+
"Vietnamese":"vi",
|
140 |
+
"Wolof":"wo",
|
141 |
+
"Xhosa":"xh",
|
142 |
+
"Yiddish":"yi",
|
143 |
+
"Yoruba":"yo",
|
144 |
+
"Chinese":"zh",
|
145 |
+
"Zulu":"zu",
|
146 |
"Let the model analyze": "Let the model analyze"
|
147 |
}
|
148 |
|
|
|
423 |
with gr.Column():
|
424 |
gr.Markdown('''
|
425 |
##### Here you can start the transcription and translation process.
|
426 |
+
##### Be aware that processing will last some time. With base model it is around 3x speed
|
427 |
+
##### Please select source language for better transcriptions. Using 'Let the model analyze' makes mistakes sometimes and may lead to bad transcriptions
|
428 |
''')
|
429 |
selected_source_lang.render()
|
430 |
selected_whisper_model.render()
|
|
|
444 |
with gr.Row():
|
445 |
with gr.Column():
|
446 |
gr.Markdown('''
|
447 |
+
##### PLEASE READ BELOW
|
448 |
+
##### Here you will can translate transcriptions to 26 languages.
|
449 |
+
##### If spoken language is not in the list, translation might not work. In this case original transcriptions are used
|
450 |
##### ''')
|
451 |
selected_translation_lang_2.render()
|
452 |
translate_transcriptions_button = gr.Button("Step 3. Translate transcription")
|