Spaces:
Sleeping
Sleeping
Download app.py from AshutoshD245/text-summarization: direct link, hf CLI and curl.
- Browser
- Download file 708 Bytes
-
https://huggingface.co/spaces/AshutoshD245/text-summarization/resolve/main/app.py
- Command line
-
hf download hf://spaces/AshutoshD245/text-summarization/app.py
-
curl -L -o app.py https://huggingface.co/spaces/AshutoshD245/text-summarization/resolve/main/app.py
708 Bytes
| from transformers import pipeline | |
| import gradio as gr | |
| get_completion = pipeline("summarization") | |
| def summarize(input): | |
| output = get_completion(input) | |
| return output[0]['summary_text'] | |
| def summarize(input): | |
| output = get_completion(input) | |
| return output[0]['summary_text'] | |
| gr.close_all() | |
| demo = gr.Interface(fn=summarize, | |
| inputs=[gr.Textbox(label="Text to summarize", lines=6)], | |
| outputs=[gr.Textbox(label="Result", lines=3)], | |
| title="Text summarization with distilbart-cnn", | |
| description="Summarize any text using the `shleifer/distilbart-cnn-12-6` model under the hood!" | |
| ) | |
| demo.launch() |