Update app.py
Browse files
app.py
CHANGED
@@ -20,13 +20,12 @@ def get_FLORES_code_from_language(language):
|
|
20 |
return entry['FLORES-200 code']
|
21 |
return None
|
22 |
|
23 |
-
|
24 |
def translate_text(text, destination_language):
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
return translation[0]["translation_text"]
|
31 |
|
32 |
gr.close_all()
|
|
|
20 |
return entry['FLORES-200 code']
|
21 |
return None
|
22 |
|
|
|
23 |
def translate_text(text, destination_language):
|
24 |
+
# text = "Hello Friends, How are you?"
|
25 |
+
dest_code= get_FLORES_code_from_language(destination_language)
|
26 |
+
translation = text_translator(text,
|
27 |
+
src_lang="eng_Latn",
|
28 |
+
tgt_lang=dest_code)
|
29 |
return translation[0]["translation_text"]
|
30 |
|
31 |
gr.close_all()
|