kumar989 commited on
Commit
5b24454
1 Parent(s): 3480ee3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -19,10 +19,7 @@ def read_pdf(pdf):
19
  return text
20
 
21
 
22
- def summarizer(pdf):
23
- # model = T5ForConditionalGeneration.from_pretrained("t5-base")
24
- # tokenizer = T5TokenizerFast.from_pretrained("t5-base")
25
- text=read_pdf(pdf)
26
  inputs = tokenizer.encode("summarize: " + text,return_tensors="pt", max_length=1000,truncation=True)
27
  outputs = model.generate(inputs,max_length=1000, min_length=100,length_penalty=2.0, num_beams=4,early_stopping=True)
28
  summary = tokenizer.decode(outputs[0])
 
19
  return text
20
 
21
 
22
+ def summarizer(text):
 
 
 
23
  inputs = tokenizer.encode("summarize: " + text,return_tensors="pt", max_length=1000,truncation=True)
24
  outputs = model.generate(inputs,max_length=1000, min_length=100,length_penalty=2.0, num_beams=4,early_stopping=True)
25
  summary = tokenizer.decode(outputs[0])