Project_Demo / app.py
Al-Chan's picture
Upload app.py
f6be78e verified
raw
history blame
283 Bytes
from transformers import pipeline
import gradio as gr
classifier = pipeline("text-classification", model="Al-Chan/Malicious_Prompt_Classifier")
def text(text):
return classifier(text)[0]['label']
demo = gr.Interface(
fn=text,
inputs=["text"],
outputs=["text"],
)