Spaces:
Runtime error
Runtime error
stephenhage
commited on
Commit
•
db95b31
1
Parent(s):
eddf7fa
return just summary text
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
|
|
4 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
5 |
|
6 |
def greet(article, max_length=130, min_length=30, do_sample=False):
|
7 |
-
return summarizer(article, max_length, min_length, do_sample)
|
8 |
|
9 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
10 |
iface.launch()
|
|
|
4 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
5 |
|
6 |
def greet(article, max_length=130, min_length=30, do_sample=False):
|
7 |
+
return summarizer(article, max_length, min_length, do_sample)[0].get('summaray_text')
|
8 |
|
9 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
10 |
iface.launch()
|