SamuelMiller commited on
Commit
1b44afc
1 Parent(s): c097763

Update summarizer.py

Browse files
Files changed (1) hide show
  1. summarizer.py +6 -8
summarizer.py CHANGED
@@ -1,9 +1,7 @@
1
- import streamlit as st
2
- from transformers import pipeline
 
3
 
4
- pipe = pipeline('summarization')
5
- text = st.text_area('enter some text!')
6
-
7
- if text:
8
- out = pipe(text)
9
- st.json(out)
 
1
+ # use bart in pytorch
2
+ summarizer = pipeline("summarization")
3
+ summarizer("An apple a day, keeps the doctor away", min_length=5, max_length=20)
4
 
5
+ # use t5 in tf
6
+ summarizer = pipeline("summarization", model="t5-base", tokenizer="t5-base", framework="tf")
7
+ summarizer("An apple a day, keeps the doctor away", min_length=5, max_length=20)