Spaces:
Runtime error
Runtime error
Jesus Carrasco
commited on
Commit
·
3bc002c
1
Parent(s):
bf83ac1
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,13 @@ def translate(text, target_language):
|
|
10 |
"Brazilian Portuguese": "pt",
|
11 |
"Japanese": "ja",
|
12 |
"Russian": "ru",
|
13 |
-
"Chinese": "zh"
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
target_language_code = language_codes[target_language]
|
16 |
model_name = f'helsinki-nlp/opus-mt-en-{target_language_code}'
|
@@ -23,7 +29,8 @@ def translate(text, target_language):
|
|
23 |
|
24 |
language_options = [
|
25 |
"Spanish", "French", "Italian", "Ukrainian", "Brazilian Portuguese",
|
26 |
-
"Japanese", "Russian", "Chinese"
|
|
|
27 |
]
|
28 |
|
29 |
iface = gr.Interface(
|
@@ -38,3 +45,4 @@ iface = gr.Interface(
|
|
38 |
iface.launch()
|
39 |
|
40 |
|
|
|
|
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",
|
18 |
+
"Hebrew": "he",
|
19 |
+
"Greek": "el"
|
20 |
}
|
21 |
target_language_code = language_codes[target_language]
|
22 |
model_name = f'helsinki-nlp/opus-mt-en-{target_language_code}'
|
|
|
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(
|
|
|
45 |
iface.launch()
|
46 |
|
47 |
|
48 |
+
|