Update app.py
Browse files
app.py
CHANGED
@@ -9,13 +9,13 @@ LANGUAGES = ['Akan', 'Arabic', ' Assamese', 'Bambara', 'Bengali', 'Catalan', 'En
|
|
9 |
'Kirundi', 'Kinyarwanda', 'Shona', 'Sotho', 'Swahili', 'Tamil', 'Telugu', 'Tswana', 'Tsonga', 'Twi', 'Urdu', 'Viêt Namese', 'Wolof', 'Xhosa',
|
10 |
'Yoruba', 'Chinese', 'Zulu']
|
11 |
|
12 |
-
API_URL = "https://api-inference.huggingface.co/models/bigscience/
|
13 |
|
14 |
|
15 |
def translate(input, output, text):
|
16 |
"""Translate text from input language to output language"""
|
17 |
|
18 |
-
instruction = f"""
|
19 |
|
20 |
json_ = {
|
21 |
"inputs": instruction,
|
|
|
9 |
'Kirundi', 'Kinyarwanda', 'Shona', 'Sotho', 'Swahili', 'Tamil', 'Telugu', 'Tswana', 'Tsonga', 'Twi', 'Urdu', 'Viêt Namese', 'Wolof', 'Xhosa',
|
10 |
'Yoruba', 'Chinese', 'Zulu']
|
11 |
|
12 |
+
API_URL = "https://api-inference.huggingface.co/models/bigscience/mt0-xxl"
|
13 |
|
14 |
|
15 |
def translate(input, output, text):
|
16 |
"""Translate text from input language to output language"""
|
17 |
|
18 |
+
instruction = f"""Translatation in {input.lower()}: {text}\nTranslation in {output.lower()}: """
|
19 |
|
20 |
json_ = {
|
21 |
"inputs": instruction,
|