Spaces:
Runtime error
Runtime error
File size: 317 Bytes
85300c0 |
1 2 3 4 5 6 7 8 9 10 11 12 |
from transformers import pipeline
def prep_pipeline():
summarizer = pipeline("summarization", model=f"Falconsai/text_summarization")
return summarizer
def gen_summary(summarizer, text):
summary = summarizer(text, max_length=130, min_length=30, do_sample=False)[0]["summary_text"]
return summary |