File size: 343 Bytes
14aa185
 
04a7e6a
14aa185
 
 
 
dd9ab56
14aa185
 
dd9ab56
14aa185
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)