Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit
|
2 |
+
from transformers import pipeline
|
3 |
+
from transformers import logging
|
4 |
+
|
5 |
+
|
6 |
+
pipe = pipeline("summarization")
|
7 |
+
|
8 |
+
logging.set_verbosity_warning()
|
9 |
+
logging.set_verbosity_error()
|
10 |
+
|
11 |
+
text = streamlit.text_area("enter text to summarize")
|
12 |
+
|
13 |
+
if text:
|
14 |
+
summary = pipe(text)[0]['summary_text']
|
15 |
+
streamlit.json(summary)
|