2seriescs commited on
Commit
f550738
1 Parent(s): f84f488

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -22,11 +22,11 @@ def get_FLORES_code_from_language(language):
22
 
23
 
24
  def translate_text(text, destination_language):
25
- dest_code = get_FLORES_code_from_language(destination_language)
26
- if dest_code is None:
27
- return "Invalid destination language."
28
-
29
- translation = text_translator(text, src_lang="eng_Latn", tgt_lang=dest_code)
30
  return translation[0]["translation_text"]
31
 
32
  gr.close_all()
 
22
 
23
 
24
  def translate_text(text, destination_language):
25
+ # text = "Hello Friends, How are you?"
26
+ dest_code= get_FLORES_code_from_language(destination_language)
27
+ translation = text_translator(text,
28
+ src_lang="eng_Latn",
29
+ tgt_lang=dest_code)
30
  return translation[0]["translation_text"]
31
 
32
  gr.close_all()