Spaces:
Running
Running
Download app.py from ISudoo/Text_Summarizer_New: direct link, hf CLI and curl.
- Browser
- Download file 613 Bytes
-
https://huggingface.co/spaces/ISudoo/Text_Summarizer_New/resolve/main/app.py
- Command line
-
hf download hf://spaces/ISudoo/Text_Summarizer_New/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ISudoo/Text_Summarizer_New/resolve/main/app.py
613 Bytes
| import torch | |
| import gradio as gr | |
| from transformers import pipeline | |
| from pathlib import Path | |
| from transformers import pipeline | |
| from transformers import pipeline | |
| text_summary = pipeline("text-generation", model="sshleifer/t5-base-cnn") | |
| def summary(input): | |
| output = text_summary(input) | |
| return output[0]['summary_text'] | |
| gr.close_all() | |
| demo=gr.Interface(fn=summary, inputs=[gr.Textbox(label="Input Text to Summarize", lines=6)], outputs=[gr.Textbox(label="Summarized Text", lines=4)], title="Project1 : Text Summarizer", description="This application will be used to summarize the text") | |
| demo.launch() | |