Spaces:
Runtime error
Runtime error
File size: 408 Bytes
44d48cd 60c033a 44d48cd 93ad074 44d48cd 60c033a 93ad074 60c033a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 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()
|