Spaces:
Build error
Build error
Commit
·
379a274
1
Parent(s):
61463dd
additional commits
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ language_map = {'English':'en','Swahili':'sw','Fon':'fon','Igbo':'ig',
|
|
| 9 |
'Arabic':'ar','Shona':'sn','Ẹ̀dó':'bin','Hausa':'ha',
|
| 10 |
'Efik':'efi','Twi':'twi','Afrikaans':'af','Yoruba':'yo'}
|
| 11 |
|
| 12 |
-
|
| 13 |
available_languages =list(language_map.keys())
|
| 14 |
|
| 15 |
|
|
@@ -49,11 +49,7 @@ def load_model(source_language_,target_language_):
|
|
| 49 |
|
| 50 |
params = load_params_for_prediction(parsed_yaml_file,best_ckpt)
|
| 51 |
return params
|
| 52 |
-
|
| 53 |
-
#Using global params for English and Swahili (default pairs for this demo) to save time taken to load them.
|
| 54 |
-
params=None
|
| 55 |
-
params = load_model('English','Swahili')
|
| 56 |
-
'''
|
| 57 |
def get_translation(source_language,target_language,source_sentence=None,source_file=None):
|
| 58 |
'''
|
| 59 |
This takes a sentence and gets the translation.
|
|
|
|
| 9 |
'Arabic':'ar','Shona':'sn','Ẹ̀dó':'bin','Hausa':'ha',
|
| 10 |
'Efik':'efi','Twi':'twi','Afrikaans':'af','Yoruba':'yo'}
|
| 11 |
|
| 12 |
+
#List of available languages I worked on.
|
| 13 |
available_languages =list(language_map.keys())
|
| 14 |
|
| 15 |
|
|
|
|
| 49 |
|
| 50 |
params = load_params_for_prediction(parsed_yaml_file,best_ckpt)
|
| 51 |
return params
|
| 52 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
def get_translation(source_language,target_language,source_sentence=None,source_file=None):
|
| 54 |
'''
|
| 55 |
This takes a sentence and gets the translation.
|