Spaces:
Runtime error
Runtime error
Download app.py from PreethiPS/Text_Summarizer: direct link, hf CLI and curl.
- Browser
- Download file 611 Bytes
-
https://huggingface.co/spaces/PreethiPS/Text_Summarizer/resolve/main/app.py
- Command line
-
hf download hf://spaces/PreethiPS/Text_Summarizer/app.py
-
curl -L -o app.py https://huggingface.co/spaces/PreethiPS/Text_Summarizer/resolve/main/app.py
611 Bytes
| import torch | |
| import gradio as gr | |
| from transformers import pipeline | |
| text_summary = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6", torch_dtype=torch.bfloat16) | |
| def summary (input): | |
| output = text_summary(input) | |
| return output[0]["summary_text"] | |
| gr.close_all() | |
| op = gr.Interface(fn=summary, | |
| inputs= [gr.Textbox(label="Enter the text:",lines=6)], | |
| outputs= [gr.Textbox(label="Summerized Text:", lines=4)], | |
| title="Text Summarizer GenAI Project1", | |
| description = "This is my first project to summarize any data.") | |
| op.launch() |