Spaces:
Runtime error
Runtime error
MohamedUgas
commited on
Commit
•
d5916a1
1
Parent(s):
38ce346
Update app.py
Browse files
app.py
CHANGED
@@ -9,12 +9,12 @@ tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
|
|
9 |
src_lang = 'som_Latn'
|
10 |
tgt_lang = "eng_Latn"
|
11 |
|
12 |
-
def translate(
|
13 |
translation_pipeline = pipeline("translation",
|
14 |
model=model,
|
15 |
tokenizer=tokenizer,
|
16 |
-
src_lang=
|
17 |
-
tgt_lang=
|
18 |
|
19 |
result = translation_pipeline(text)
|
20 |
return result[0]['translation_text']
|
|
|
9 |
src_lang = 'som_Latn'
|
10 |
tgt_lang = "eng_Latn"
|
11 |
|
12 |
+
def translate(src_lang, tgt_lang, text):
|
13 |
translation_pipeline = pipeline("translation",
|
14 |
model=model,
|
15 |
tokenizer=tokenizer,
|
16 |
+
src_lang=src_lang,
|
17 |
+
tgt_lang=tgt_lang)
|
18 |
|
19 |
result = translation_pipeline(text)
|
20 |
return result[0]['translation_text']
|