chayyyy commited on
Commit
7c6189a
1 Parent(s): 0f3cc9c

Update app.py

Browse files
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