Daniel Tse
commited on
Commit
·
f8474ce
1
Parent(s):
f3e24b8
Change to use Facebook Summarizer
Browse files
app.py
CHANGED
|
@@ -4,9 +4,9 @@ from transformers import pipeline
|
|
| 4 |
x = st.slider('Select a value')
|
| 5 |
st.write(x, 'squared is', x * x)
|
| 6 |
|
| 7 |
-
pipe = pipeline('
|
| 8 |
text = st.text_area('enter some text')
|
| 9 |
|
| 10 |
if text:
|
| 11 |
-
out = pipe(text)
|
| 12 |
st.json(out)
|
|
|
|
| 4 |
x = st.slider('Select a value')
|
| 5 |
st.write(x, 'squared is', x * x)
|
| 6 |
|
| 7 |
+
pipe = pipeline("summarization", model='facebook/bart-large-cnn')
|
| 8 |
text = st.text_area('enter some text')
|
| 9 |
|
| 10 |
if text:
|
| 11 |
+
out = pipe(text, max_length=130, min_length=30, do_sample=False)
|
| 12 |
st.json(out)
|