Jesus Carrasco commited on
Commit
d86acb9
1 Parent(s): 3bc002c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -4,14 +4,14 @@ from transformers import MarianMTModel, MarianTokenizer
4
  def translate(text, target_language):
5
  language_codes = {
6
  "Spanish": "es",
7
- "French": "fr",
 
8
  "Italian": "it",
9
  "Ukrainian": "uk",
10
- "Brazilian Portuguese": "pt",
11
- "Japanese": "ja",
12
  "Russian": "ru",
13
  "Chinese": "zh",
14
- "Moroccan Arabic": "ary",
15
  "Dutch": "nl",
16
  "German": "de",
17
  "Arabic": "ar",
@@ -28,9 +28,9 @@ def translate(text, target_language):
28
  return translation
29
 
30
  language_options = [
31
- "Spanish", "French", "Italian", "Ukrainian", "Brazilian Portuguese",
32
- "Japanese", "Russian", "Chinese", "Moroccan Arabic", "Dutch",
33
- "German", "Arabic", "Hebrew", "Greek"
34
  ]
35
 
36
  iface = gr.Interface(
@@ -46,3 +46,4 @@ iface.launch()
46
 
47
 
48
 
 
 
4
  def translate(text, target_language):
5
  language_codes = {
6
  "Spanish": "es",
7
+ "French (European)": "fr",
8
+ "French (Canadian)": "fr",
9
  "Italian": "it",
10
  "Ukrainian": "uk",
11
+ "Portuguese (Brazilian)": "pt_BR",
12
+ "Portuguese (European)": "pt",
13
  "Russian": "ru",
14
  "Chinese": "zh",
 
15
  "Dutch": "nl",
16
  "German": "de",
17
  "Arabic": "ar",
 
28
  return translation
29
 
30
  language_options = [
31
+ "Spanish", "French (European)", "French (Canadian)", "Italian", "Ukrainian",
32
+ "Portuguese (Brazilian)", "Portuguese (European)", "Russian", "Chinese",
33
+ "Dutch", "German", "Arabic", "Hebrew", "Greek"
34
  ]
35
 
36
  iface = gr.Interface(
 
46
 
47
 
48
 
49
+