Spaces:
Runtime error
Runtime error
| from transformers import pipeline | |
| import gradio as gr | |
| def summarize(content,size): | |
| bot=pipeline('summarization',model='Falconsai/text_summarization') | |
| text=content | |
| if size=='' : | |
| size='50' | |
| result=bot(text,min_length=int(size)) | |
| return result[0]['summary_text'] | |
| with gr.Blocks(theme=gr.themes.Soft()) as window: | |
| gr.Markdown('5th gen text summarizer') | |
| inp=gr.Textbox(label=' ',placeholder='Enter the text you want ot summarize') | |
| length=gr.Textbox(label='Length') | |
| btn=gr.Button('Summarize') | |
| out=gr.TextArea(label=' ') | |
| btn.click(fn=summarize,inputs=[inp,length],outputs=out) | |
| window.launch() |