Upload stt.py
Browse files
stt.py
CHANGED
|
@@ -9,14 +9,15 @@ import whisper
|
|
| 9 |
_model = None
|
| 10 |
|
| 11 |
# Maps the app's language selection to Whisper's language codes.
|
| 12 |
-
# Whisper
|
| 13 |
-
#
|
| 14 |
-
#
|
|
|
|
| 15 |
LANGUAGE_MAP = {
|
| 16 |
"english": "en",
|
| 17 |
"yoruba": "yo",
|
| 18 |
"hausa": "ha",
|
| 19 |
-
"igbo": "
|
| 20 |
"pidgin": "en",
|
| 21 |
}
|
| 22 |
|
|
|
|
| 9 |
_model = None
|
| 10 |
|
| 11 |
# Maps the app's language selection to Whisper's language codes.
|
| 12 |
+
# Whisper supports Yoruba ("yo") and Hausa ("ha") natively.
|
| 13 |
+
# Igbo has no Whisper language code, so it falls back to English,
|
| 14 |
+
# same as Pidgin. Both are close enough to romanized Latin script
|
| 15 |
+
# that Whisper can still produce a usable transcription.
|
| 16 |
LANGUAGE_MAP = {
|
| 17 |
"english": "en",
|
| 18 |
"yoruba": "yo",
|
| 19 |
"hausa": "ha",
|
| 20 |
+
"igbo": "en",
|
| 21 |
"pidgin": "en",
|
| 22 |
}
|
| 23 |
|