import streamlit as st | |
from transformers import pipeline | |
summarizer = pipeline("summarization") | |
summarizer("An apple a day, keeps the doctor away", min_length=5, max_length=30) | |
if query := st.chat_input("Summarize: "): | |
ans = summarizer(query, min_length=5, max_length=30) | |
with st.chat_message("User"): | |
st.write(ans) | |