Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,11 +2,11 @@
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
-
pipe = pipeline(task="text-classification", model="TostAI/nsfw-text-detection-large")
|
| 6 |
|
| 7 |
def predict(input_txt):
|
| 8 |
predictions = pipe(input_txt)
|
| 9 |
-
return
|
| 10 |
|
| 11 |
gradio_app = gr.Interface(
|
| 12 |
predict,
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
+
pipe = pipeline(task="text-classification", model="TostAI/nsfw-text-detection-large", return_all_scores=1)
|
| 6 |
|
| 7 |
def predict(input_txt):
|
| 8 |
predictions = pipe(input_txt)
|
| 9 |
+
return predictions[0]
|
| 10 |
|
| 11 |
gradio_app = gr.Interface(
|
| 12 |
predict,
|