Soumen commited on
Commit
bc02731
1 Parent(s): 3d283a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -62,14 +62,10 @@ def read_pdf(file):
62
  # # Display the extracted text
63
  # #st.text(extracted_text)
64
  # return extracted_text
65
- @st.cache
66
- def l():
67
- tokenizer = AutoTokenizer.from_pretrained('t5-base')
68
- model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
69
- return tokenizer, model
70
  @st.cache(suppress_st_warning=True)
71
  def engsum(text):
72
- tokenizer, model = l()
73
  #st.text("Using Google T5 Transformer ..")
74
  inputs = tokenizer.encode("summarize: " + text,return_tensors='pt',
75
  max_length= 512,
 
62
  # # Display the extracted text
63
  # #st.text(extracted_text)
64
  # return extracted_text
65
+ tokenizer = AutoTokenizer.from_pretrained('t5-base')
66
+ model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
 
 
 
67
  @st.cache(suppress_st_warning=True)
68
  def engsum(text):
 
69
  #st.text("Using Google T5 Transformer ..")
70
  inputs = tokenizer.encode("summarize: " + text,return_tensors='pt',
71
  max_length= 512,