Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,10 +2,10 @@
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
#def predict(input_txt):
|
| 8 |
-
# predictions =
|
| 9 |
# return {p["label"]: p["score"] for p in predictions}
|
| 10 |
|
| 11 |
#gradio_app = gr.Interface(
|
|
@@ -15,7 +15,7 @@ pipeline = pipeline(task="text-classification", model="TostAI/nsfw-text-detectio
|
|
| 15 |
# title="NSFW Prediction",
|
| 16 |
#)
|
| 17 |
|
| 18 |
-
gradio_app = gr.Interface.from_pipeline(
|
| 19 |
|
| 20 |
if __name__ == "__main__":
|
| 21 |
gradio_app.launch()
|
|
|
|
| 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 {p["label"]: p["score"] for p in predictions}
|
| 10 |
|
| 11 |
#gradio_app = gr.Interface(
|
|
|
|
| 15 |
# title="NSFW Prediction",
|
| 16 |
#)
|
| 17 |
|
| 18 |
+
gradio_app = gr.Interface.from_pipeline(pipe)
|
| 19 |
|
| 20 |
if __name__ == "__main__":
|
| 21 |
gradio_app.launch()
|