vnarasiman's picture
Create app.py
13a9f49 verified
raw
history blame contribute delete
383 Bytes
from transformers import pipeline
import gradio as gr
clf = pipeline("text-classification", model="vnarasiman/unwrap-base")
def predict(text):
result = clf(text)[0]
return {"label": result["label"], "confidence": round(result["score"], 3)}
gr.Interface(
fn=predict,
inputs=gr.Textbox(placeholder="Paste a Reddit comment here..."),
outputs=gr.JSON(),
).launch()