sharath6900 commited on
Commit
1323910
·
verified ·
1 Parent(s): 26606dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -1,16 +1,16 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
- # Load the summarization pipeline
5
- summarizer = pipeline("summarization")
6
 
7
  def summarize_text(text):
8
- """Summarize the input text using Hugging Face's pipeline."""
9
  summary = summarizer(text, max_length=150, min_length=50, do_sample=False)
10
  return summary[0]['summary_text']
11
 
12
  # Streamlit UI
13
- st.title("Text Summarization with Hugging Face")
14
 
15
  st.write("Enter the text you want to summarize:")
16
 
@@ -25,4 +25,3 @@ if st.button("Summarize"):
25
  st.write(summary)
26
  else:
27
  st.error("Please enter some text to summarize.")
28
-
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+ # Load the T5 summarization pipeline
5
+ summarizer = pipeline("summarization", model="t5-small", tokenizer="t5-small")
6
 
7
  def summarize_text(text):
8
+ """Summarize the input text using the T5 model."""
9
  summary = summarizer(text, max_length=150, min_length=50, do_sample=False)
10
  return summary[0]['summary_text']
11
 
12
  # Streamlit UI
13
+ st.title("Text Summarization with T5")
14
 
15
  st.write("Enter the text you want to summarize:")
16
 
 
25
  st.write(summary)
26
  else:
27
  st.error("Please enter some text to summarize.")