jjuarez chayyyy commited on
Commit
9f2d4e6
1 Parent(s): 0f3cc9c

Update app.py (#1)

Browse files

- Update app.py (7c6189a2e98a0e1c45f5d473c6e81c32da027b4f)


Co-authored-by: mes <[email protected]>

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -5,7 +5,7 @@ tokenizer = AutoTokenizer.from_pretrained("ieuniversity/sciencebrief_translation
5
  model = AutoModelForSeq2SeqLM.from_pretrained("ieuniversity/sciencebrief_translation")
6
 
7
  def translate(text):
8
- input_ids = tokenizer.encode(text, return_tensors="pt")
9
  output_ids = model.generate(input_ids)
10
  output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
11
  return output_text
 
5
  model = AutoModelForSeq2SeqLM.from_pretrained("ieuniversity/sciencebrief_translation")
6
 
7
  def translate(text):
8
+ input_ids = tokenizer(text, return_tensors="pt", truncation=True)['input_ids']
9
  output_ids = model.generate(input_ids)
10
  output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
11
  return output_text