Gladiator commited on
Commit
d6f77b5
1 Parent(s): e348197

cache bert models (extractive sum)

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -21,10 +21,10 @@ def abstractive_summarizer(text : str, model):
21
 
22
  return abs_summarized_text
23
 
24
- @st.cache()
25
- def load_ext_model():
26
- model = Summarizer()
27
- return model
28
 
29
  @st.cache()
30
  def load_abs_model():
@@ -52,7 +52,7 @@ if __name__ == "__main__":
52
  if summarize_type == "Extractive":
53
  # extractive summarizer
54
 
55
- ext_model = load_ext_model()
56
  summarized_text = ext_model(inp_text, num_sentences=5)
57
 
58
  elif summarize_type == "Abstractive":
 
21
 
22
  return abs_summarized_text
23
 
24
+ # @st.cache()
25
+ # def load_ext_model():
26
+ # model = Summarizer()
27
+ # return model
28
 
29
  @st.cache()
30
  def load_abs_model():
 
52
  if summarize_type == "Extractive":
53
  # extractive summarizer
54
 
55
+ ext_model = Summarizer()
56
  summarized_text = ext_model(inp_text, num_sentences=5)
57
 
58
  elif summarize_type == "Abstractive":