Project_Demo / app.py
Al-Chan's picture
Update app.py
167a426 verified
raw
history blame contribute delete
329 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"],
)
if __name__ == "__main__":
demo.launch()