Spaces:
Running
Running
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() | |