Spaces:
Runtime error
Runtime error
Download app.py from mahrukhsaeed/mlops: direct link, hf CLI and curl.
- Browser
- Download file 378 Bytes
-
https://huggingface.co/spaces/mahrukhsaeed/mlops/resolve/main/app.py
- Command line
-
hf download hf://spaces/mahrukhsaeed/mlops/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mahrukhsaeed/mlops/resolve/main/app.py
378 Bytes
| from transformers import pipeline | |
| import gradio as gr | |
| # Force framework to PyTorch (no TF/Keras dependency) | |
| model = pipeline("summarization", model="google-t5/t5-small", framework="pt") | |
| def predict(prompt): | |
| summary = model(prompt)[0]["summary_text"] | |
| return summary | |
| # Gradio interface | |
| with gr.Interface(predict, "textbox", "text") as interface: | |
| interface.launch() | |