Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,11 @@ from transformers import pipeline
|
|
3 |
|
4 |
pipe = pipeline("text-classification", model="p1atdev/saikyou-shield-30m")
|
5 |
|
6 |
-
def classify(text):
|
7 |
-
return
|
|
|
|
|
|
|
8 |
|
9 |
demo = gr.Interface(
|
10 |
fn=classify,
|
|
|
3 |
|
4 |
pipe = pipeline("text-classification", model="p1atdev/saikyou-shield-30m")
|
5 |
|
6 |
+
def classify(text):
|
7 |
+
return labels = {
|
8 |
+
item["label"]: item["score"]
|
9 |
+
for item in pipe(text, top_k=2)
|
10 |
+
}
|
11 |
|
12 |
demo = gr.Interface(
|
13 |
fn=classify,
|