Jesus Carrasco commited on
Commit
3d23272
1 Parent(s): d92b9a6

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,6 +7,7 @@ def translate_text(text, target_language):
7
  "Spanish": "Helsinki-NLP/opus-mt-en-es",
8
  "French": "Helsinki-NLP/opus-mt-en-fr",
9
  "Italian": "Helsinki-NLP/opus-mt-en-it",
 
10
  }
11
 
12
  tokenizer = MarianTokenizer.from_pretrained(model_name[target_language])
@@ -24,7 +25,7 @@ def translate_text(text, target_language):
24
  return translated_text
25
 
26
  # Define the Gradio interface
27
- language_options = ["Spanish", "French", "Italian"]
28
  inputs = [
29
  gr.inputs.Textbox(lines=5, label="Enter text to translate:"),
30
  gr.inputs.Dropdown(choices=language_options, label="Select target language:"),
 
7
  "Spanish": "Helsinki-NLP/opus-mt-en-es",
8
  "French": "Helsinki-NLP/opus-mt-en-fr",
9
  "Italian": "Helsinki-NLP/opus-mt-en-it",
10
+ "Ukrainian": "Helsinki-NLP/opus-mt-en-uk",
11
  }
12
 
13
  tokenizer = MarianTokenizer.from_pretrained(model_name[target_language])
 
25
  return translated_text
26
 
27
  # Define the Gradio interface
28
+ language_options = ["Spanish", "French", "Italian", "Ukrainian"]
29
  inputs = [
30
  gr.inputs.Textbox(lines=5, label="Enter text to translate:"),
31
  gr.inputs.Dropdown(choices=language_options, label="Select target language:"),