runaksh commited on
Commit
3e0f5ff
·
1 Parent(s): 81ee630

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,9 +13,9 @@ loaded_tokenizer = AutoTokenizer.from_pretrained("runaksh/financial_summary_T5_b
13
  # Function for generating summary
14
  def generate_summary(text,min_length=55,max_length=80):
15
  text = "summarize: "+text
16
- input = tokenizer(text,max_length=512,truncation=True,return_tensors='tf').input_ids
17
- op=model.generate(input,min_length=min_length,max_length=max_length)
18
- decoded_op = tokenizer.batch_decode(op,skip_special_tokens=True)
19
  return decoded_op
20
 
21
  title = "Financial News Summary"
 
13
  # Function for generating summary
14
  def generate_summary(text,min_length=55,max_length=80):
15
  text = "summarize: "+text
16
+ input = loaded_tokenizer(text,max_length=512,truncation=True,return_tensors='tf').input_ids
17
+ op=loaded_model.generate(input,min_length=min_length,max_length=max_length)
18
+ decoded_op = loaded_tokenizer.batch_decode(op,skip_special_tokens=True)
19
  return decoded_op
20
 
21
  title = "Financial News Summary"