Spaces:
Runtime error
Runtime error
| import torch | |
| import gradio as gr | |
| from transformers import pipeline | |
| text_summary = pipeline("summarization", model= "sshleifer/distilbart-xsum-12-6" ) | |
| def summarise_txt(input): | |
| output = text_summary(input) | |
| return output[0]['summary_text'] | |
| gr.close_all() | |
| demo = gr.Interface( | |
| fn= summarise_txt, | |
| inputs= [gr.Textbox(label="input a text to summarize in here", lines=8)], | |
| outputs= [gr.Textbox(label= "text after summarization", lines= 4)], | |
| title= "text summarizer project", | |
| description= "the project takes a text as input and a summarized text as an output using hugging face models" | |
| ) | |
| demo.launch() | |