Spaces:
Runtime error
Runtime error
Download app.py from am230/text-priority: direct link, hf CLI and curl.
- Browser
- Download file 408 Bytes
-
https://huggingface.co/spaces/am230/text-priority/resolve/main/app.py
- Command line
-
hf download hf://spaces/am230/text-priority/app.py
-
curl -L -o app.py https://huggingface.co/spaces/am230/text-priority/resolve/main/app.py
408 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| model = pipeline( | |
| task="text-classification", | |
| model="am230/text-priority", | |
| ) | |
| def predict(text): | |
| predictions = model(text) | |
| return {p["label"]: p["score"] for p in predictions} | |
| gr.Interface( | |
| predict, | |
| inputs=gr.Textbox(lines=5, label="Input Text"), | |
| outputs=gr.Label(num_top_classes=2), | |
| title="Text Priority", | |
| ).launch() | |