Download app.py from Curtec/BriefMe: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/spaces/Curtec/BriefMe/resolve/main/app.py
- Command line
-
hf download hf://spaces/Curtec/BriefMe/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Curtec/BriefMe/resolve/main/app.py
413 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| import torch | |
| summariser = pipeline(task="summarization", model="t5-base", tokenizer="t5-base") | |
| def get_summary(text): | |
| summary = summariser(text, min_length=5, max_length=100) | |
| return summary[0]["summary_text"] | |
| iface = gr.Interface(fn=get_summary, | |
| inputs="text", | |
| outputs=['text']) | |
| iface.launch(share=False) | |