japanese-denim commited on
Commit
d096912
1 Parent(s): d0274d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -7,16 +7,16 @@ model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
7
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
8
 
9
 
10
- src_lang = 'en_XX'
11
- tgt_lang = "ng_XX"
12
 
13
 
14
  def translate(text):
15
  translation_pipeline = pipeline("translation",
16
  model=model,
17
- tokenizer = tokenizer
18
- src_lang=src_lang,
19
- tgt_lang=tgt_lang)
20
 
21
  result = translation_pipeline(text)
22
  return result[0]['translation_text']
 
7
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
8
 
9
 
10
+ # src_lang = 'en_XX'
11
+ # tgt_lang = "ng_XX"
12
 
13
 
14
  def translate(text):
15
  translation_pipeline = pipeline("translation",
16
  model=model,
17
+ tokenizer = tokenizer,
18
+ src_lang='en_XX',
19
+ tgt_lang='ng_XX')
20
 
21
  result = translation_pipeline(text)
22
  return result[0]['translation_text']