Download app.py from gnithie/demoapp: direct link, hf CLI and curl.
- Browser
- Download file 297 Bytes
-
https://huggingface.co/spaces/gnithie/demoapp/resolve/main/app.py
- Command line
-
hf download hf://spaces/gnithie/demoapp/app.py
-
curl -L -o app.py https://huggingface.co/spaces/gnithie/demoapp/resolve/main/app.py
297 Bytes
| from transformers import pipeline | |
| import gradio as gr | |
| model = pipeline("summarization") | |
| def predict(prompt): | |
| summary = model(prompt)[0]['summary_text'] | |
| return summary | |
| # create an interface for the model | |
| with gr.Interface(predict, "textbox", "text") as interface: | |
| interface.launch() | |