Spaces:
Sleeping
Sleeping
File size: 435 Bytes
4ce523b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import gradio as gr
import transformers
from transformers import pipeline
model_name = "lsb/wikipedia-protected-classes"
model_name = "lsb/test_trainer" # lol no time to get it right
pipe = pipeline("text-classification", model_name)
def predict(text):
return "🛡️ Protected" if pipe(text)[0]['label'] == "LABEL_1" else "✅ General Interest"
iface = gr.Interface(fn=predict, inputs="text", outputs="text")
iface.launch()
|