Spaces:
Runtime error
Runtime error
Delete app.py
Browse files123456789101112131415161718192021222324import gradio as grfrom transformers import pipeline
# Load the summarization modelsummarizer = pipeline("summarization", model="facebook/bart-large-cnn")
# Define the summarization functiondef summarize_text(text): if not text.strip(): return "Please enter some text to summarize." summary = summarizer(text, max_length=130, min_length=30, do_sample=False) return summary[0]['summary_text']
# Set up the Gradio interfaceiface = gr.Interface( fn=summarize_text, inputs=gr.Textbox(lines=15, label="Enter text to summarize"), outputs=gr.Textbox(label="Summary"), title="Text Summarizer", description="Paste long text and get a summary using BART model.")
# Launch the appiface.launch()app.pyDeleted-24