madanagrawal commited on
Commit
a356742
1 Parent(s): b227ad0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -28,7 +28,7 @@ max_length = st.slider("Select the maximum length of the summary:", min_value=50
28
  # Create a button to trigger the summarization
29
  if st.button("Summarize"):
30
  if text_input:
31
- inputs = tokenizer(text_input, return_tensors="pt").input_ids
32
 
33
  # Generate the summary
34
  summary = summarizer.generate(inputs, max_new_tokens=max_length, do_sample=False)
@@ -42,6 +42,4 @@ if st.button("Summarize"):
42
  # Add some information about the app
43
  st.markdown("---")
44
  st.markdown("This app uses the BART-large-CNN model from Hugging Face for text summarization.")
45
- st.markdown("You can adjust the maximum length of the summary using the slider above.")
46
-
47
-
 
28
  # Create a button to trigger the summarization
29
  if st.button("Summarize"):
30
  if text_input:
31
+ inputs = tokenizer(text_input, return_tensors="pt").input_ids
32
 
33
  # Generate the summary
34
  summary = summarizer.generate(inputs, max_new_tokens=max_length, do_sample=False)
 
42
  # Add some information about the app
43
  st.markdown("---")
44
  st.markdown("This app uses the BART-large-CNN model from Hugging Face for text summarization.")
45
+ st.markdown("You can adjust the maximum length of the summary using the slider above.")