Spaces:
Build error
Build error
Download app.py from shankulpatel1/summarizer: direct link, hf CLI and curl.
- Browser
- Download file 350 Bytes
-
https://huggingface.co/spaces/shankulpatel1/summarizer/resolve/main/app.py
- Command line
-
hf download hf://spaces/shankulpatel1/summarizer/app.py
-
curl -L -o app.py https://huggingface.co/spaces/shankulpatel1/summarizer/resolve/main/app.py
350 Bytes
| import gradio as gr | |
| import transformers | |
| import torch | |
| from transformers import pipeline | |
| summarizer = pipeline("summarization", model="google-t5/t5-base", tokenizer="google-t5/t5-base", framework="pt") | |
| def summarize(text): | |
| return summarizer(text, max_length=20) | |
| demo = gr.Interface(fn=summarize, inputs="text", outputs="text") | |
| demo.launch() |