abdulmatinomotoso commited on
Commit
eb10631
1 Parent(s): a1cb754

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,10 +20,10 @@ def get_adult_content(text):
20
  probs = softmax(logits)[0]
21
  probs = probs.cpu().detach().numpy()
22
 
23
- max_index = np.argmax(probs)
24
- adult_content = labels[max_index]
25
  return adult_content
26
-
27
  demo = gr.Interface(get_adult_content, inputs = gr.inputs.Textbox(label= "Input your text here"),
28
  outputs = gr.outputs.Textbox(label='Category'))
29
 
 
20
  probs = softmax(logits)[0]
21
  probs = probs.cpu().detach().numpy()
22
 
23
+ #max_index = np.argmax(probs)
24
+
25
  return adult_content
26
+ adult_content = f"{labels[0]} : {round(probs[0]*100,2)} {labels[1]} : {round(probs[1]*100,2)}"
27
  demo = gr.Interface(get_adult_content, inputs = gr.inputs.Textbox(label= "Input your text here"),
28
  outputs = gr.outputs.Textbox(label='Category'))
29