Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ pipeline = pipeline(task="text-classification", model="TostAI/nsfw-text-detectio
|
|
| 6 |
|
| 7 |
def predict(input_txt):
|
| 8 |
predictions = pipeline(input_txt)
|
| 9 |
-
return
|
| 10 |
|
| 11 |
gradio_app = gr.Interface(
|
| 12 |
predict,
|
|
|
|
| 6 |
|
| 7 |
def predict(input_txt):
|
| 8 |
predictions = pipeline(input_txt)
|
| 9 |
+
return {p["label"]: p["score"] for p in predictions}
|
| 10 |
|
| 11 |
gradio_app = gr.Interface(
|
| 12 |
predict,
|