Spaces:
No application file
No application file
Commit ·
1b44afc
1
Parent(s): c097763
Update summarizer.py
Browse files- summarizer.py +6 -8
summarizer.py
CHANGED
|
@@ -1,9 +1,7 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 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)
|
|
|
|
|
|
|
|
|