Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ pipe = pipeline(task="text-classification", model="TostAI/nsfw-text-detection-la
|
|
| 6 |
|
| 7 |
def predict(input_txt):
|
| 8 |
predictions = pipe(input_txt)
|
| 9 |
-
return predictions[0]
|
| 10 |
|
| 11 |
gradio_app = gr.Interface(
|
| 12 |
predict,
|
|
|
|
| 6 |
|
| 7 |
def predict(input_txt):
|
| 8 |
predictions = pipe(input_txt)
|
| 9 |
+
return {'safe': predictions[0]['score'], 'questionable': predictions[0]['score'], 'unsafe': predictions[0]['score']}
|
| 10 |
|
| 11 |
gradio_app = gr.Interface(
|
| 12 |
predict,
|