Al-Chan commited on
Commit
f6be78e
1 Parent(s): 6682e6c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+
5
+ classifier = pipeline("text-classification", model="Al-Chan/Malicious_Prompt_Classifier")
6
+
7
+ def text(text):
8
+ return classifier(text)[0]['label']
9
+
10
+ demo = gr.Interface(
11
+ fn=text,
12
+ inputs=["text"],
13
+ outputs=["text"],
14
+ )