fw7th commited on
Commit
b1b17c2
·
1 Parent(s): 409ea56

Made site shareable

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -33,7 +33,7 @@ def moderate_image(img):
33
  def classify_toxic(text):
34
  batch = tokenizer.encode(text, return_tensors="pt")
35
  output = model(batch)
36
- output = output.tolist()
37
  max_idx = max(output)
38
  return "Toxic" if output.index(max_idx) == 1 else "Neutral"
39
 
@@ -164,4 +164,4 @@ with gr.Blocks(
164
  gr.Markdown("<div class='footer'>Demo by 7th • Powered by Transformers</div>")
165
 
166
  if __name__ == "__main__":
167
- demo.launch()
 
33
  def classify_toxic(text):
34
  batch = tokenizer.encode(text, return_tensors="pt")
35
  output = model(batch)
36
+ output = output[0].tolist()
37
  max_idx = max(output)
38
  return "Toxic" if output.index(max_idx) == 1 else "Neutral"
39
 
 
164
  gr.Markdown("<div class='footer'>Demo by 7th • Powered by Transformers</div>")
165
 
166
  if __name__ == "__main__":
167
+ demo.launch(share=True)