Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| import torch | |
| summarizer = pipeline( | |
| "summarization", | |
| 'pszemraj/led-large-book-summary' | |
| ) | |
| def summarize_text(text): | |
| result = summarizer(text) | |
| return result[0]["summary_text"] | |
| with gr.Blocks() as demo: | |
| gr.Markdown("##Summarize your Text by Muhammad Hassaan") | |
| gr.Markdown("May make mistakes.") | |
| text = gr.Textbox(label="Text Input", placeholder="Enter your text......") | |
| submit_btn = gr.Button("Summarize") | |
| summary = gr.Textbox(label="Summary") | |
| submit_btn.click(fn=summarize_text, inputs=text, outputs=summary) | |
| demo.launch() |