abdulmatinomotoso commited on
Commit
cf5e860
·
1 Parent(s): 87928df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -43,12 +43,12 @@ model_2 = AutoModelForSeq2SeqLM.from_pretrained(model_type_2, use_auth_token='ap
43
  #Defining a function to generate the headlines
44
  def headline_generator_2(file):
45
  input_text = clean_text(file.name)
46
- #input_text = sent_tokenize(input_text)
47
- #text = ''.join(input_text[:10])
48
 
49
  with tokenizer_2.as_target_tokenizer():
50
  batch = tokenizer_2(
51
- input_text, truncation=True, padding="longest", return_tensors="pt"
52
  )
53
 
54
  translated = model_2.generate(**batch)
 
43
  #Defining a function to generate the headlines
44
  def headline_generator_2(file):
45
  input_text = clean_text(file.name)
46
+ input_text = sent_tokenize(input_text)
47
+ text = ''.join(input_text[:10])
48
 
49
  with tokenizer_2.as_target_tokenizer():
50
  batch = tokenizer_2(
51
+ text, truncation=True, return_tensors="pt"
52
  )
53
 
54
  translated = model_2.generate(**batch)