ThirdFourthFifth commited on
Commit
b3cb78d
·
verified ·
1 Parent(s): 40a565e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,10 +2,10 @@
2
  import gradio as gr
3
  from transformers import pipeline
4
 
5
- pipeline = pipeline(task="text-classification", model="TostAI/nsfw-text-detection-large")
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(
@@ -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(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()