vibey commited on
Commit
82036b8
1 Parent(s): 64b9cf1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -38,7 +38,7 @@ def main():
38
  st.sidebar.markdown("<h4 style = 'color:green; align:center; font-size: 20px;'> Model Settings</h1>", unsafe_allow_html=True)
39
  max_length= st.sidebar.slider("Maximum length of the generated text",min_value=100,max_value=500)
40
  min_length= st.sidebar.slider("Minimum length of the generated text",min_value=30)
41
- model_type = st.sidebar.selectbox("Model type", options=["Bart","T5", "Bart + T5"])
42
 
43
  # This function is used to upload a .txt, .pdf, .docx file for summarization
44
  upload_doc = st.file_uploader("Upload a .txt, .pdf, .docx file for summarisation")
@@ -76,12 +76,12 @@ def main():
76
  summarized_text = summarizer_model(text_to_summarize, max_length=max_length, min_length=min_length)
77
  summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
78
 
79
- elif model_type == "Bart + T5":
80
  text_to_summarize = clean_text
81
 
82
  with st.spinner(
83
- text="Loading Bart + T5 Models and Extracting summary. This might take a few seconds depending on the length of your text..."):
84
- summarizer_model = bart_t5()
85
  summarized_text = summarizer_model(text_to_summarize, max_length=max_length, min_length=min_length)
86
  summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
87
 
 
38
  st.sidebar.markdown("<h4 style = 'color:green; align:center; font-size: 20px;'> Model Settings</h1>", unsafe_allow_html=True)
39
  max_length= st.sidebar.slider("Maximum length of the generated text",min_value=100,max_value=500)
40
  min_length= st.sidebar.slider("Minimum length of the generated text",min_value=30)
41
+ model_type = st.sidebar.selectbox("Model type", options=["Bart","T5", "SSR"])
42
 
43
  # This function is used to upload a .txt, .pdf, .docx file for summarization
44
  upload_doc = st.file_uploader("Upload a .txt, .pdf, .docx file for summarisation")
 
76
  summarized_text = summarizer_model(text_to_summarize, max_length=max_length, min_length=min_length)
77
  summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
78
 
79
+ elif model_type == "SSR":
80
  text_to_summarize = clean_text
81
 
82
  with st.spinner(
83
+ text="Loading SSR Model and Extracting summary. This might take a few seconds depending on the length of your text..."):
84
+ summarizer_model = ssr()
85
  summarized_text = summarizer_model(text_to_summarize, max_length=max_length, min_length=min_length)
86
  summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
87