Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,9 @@ from transformers import pipeline
|
|
2 |
import gradio as gr
|
3 |
|
4 |
def get_summary(text):
|
5 |
-
|
6 |
-
|
|
|
7 |
|
8 |
gr.Interface(fn=get_summary, inputs="text", outputs="text").launch()
|
9 |
|
|
|
2 |
import gradio as gr
|
3 |
|
4 |
def get_summary(text):
|
5 |
+
summarizer = pipeline("summarization", model="gmurro/bart-large-finetuned-filtered-spotify-podcast-summ", tokenizer="gmurro/bart-large-finetuned-filtered-spotify-podcast-summ")
|
6 |
+
summary = summarizer(text, min_length=39, max_length=25000)
|
7 |
+
return summary[0]['summary_text']
|
8 |
|
9 |
gr.Interface(fn=get_summary, inputs="text", outputs="text").launch()
|
10 |
|