Spaces:
Running
Running
File size: 739 Bytes
e96964b 2d8e2b5 e96964b ff51eba 2d8e2b5 e96964b 2d8e2b5 e96964b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import streamlit as st
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("Chillyblast/Bart_Summarization")
model = AutoModelForSeq2SeqLM.from_pretrained("Chillyblast/Bart_Summarization")
# Create a pipeline for text summarization
summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
# Streamlit app
st.title("Text Summarization App")
# Create a text input box for user input
dialogue = st.text_area("Enter the input:")
if dialogue:
# Perform inference
summary = summarizer(dialogue, max_length=500, min_length=300, do_sample=False)
# Display the summary
st.write("Summary:", summary[0]['summary_text']) |