MohamedUgas commited on
Commit
d5916a1
1 Parent(s): 38ce346

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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(source, target, text):
13
  translation_pipeline = pipeline("translation",
14
  model=model,
15
  tokenizer=tokenizer,
16
- src_lang=source,
17
- tgt_lang=target)
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']