Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # Load the summarization pipeline | |
| summarizer = pipeline("summarization") | |
| def summarize_text(text): | |
| summary = summarizer(text, max_length=130, min_length=30, do_sample=False)[0]['summary_text'] | |
| return summary | |
| iface = gr.Interface(fn=summarize_text, inputs="textbox", outputs="textbox", title="Text Summarizer", description="Enter text to get a summarized version.") | |
| iface.launch() |