ankush-003 commited on
Commit
c5cc59e
1 Parent(s): 0749cb7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -17,12 +17,13 @@ def predict(payload, malitious):
17
  predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])
18
  # print(model.config.id2label[predicted_class_id])
19
  expected = "Malitious" if malitious else "Benign"
 
20
  return model.config.id2label[predicted_class_id], expected
21
 
22
  demo = gr.Interface(
23
  fn=predict,
24
  inputs=["text","checkbox"],
25
- outputs=["text","text"]
26
  )
27
  demo.launch(debug=True)
28
  # gr.Interface.load("models/ankush-003/nosqli_identifier").launch()
 
17
  predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])
18
  # print(model.config.id2label[predicted_class_id])
19
  expected = "Malitious" if malitious else "Benign"
20
+
21
  return model.config.id2label[predicted_class_id], expected
22
 
23
  demo = gr.Interface(
24
  fn=predict,
25
  inputs=["text","checkbox"],
26
+ outputs=[gr.Textbox(label="Model Prediction"),gr.Textbox(label="Expected")]
27
  )
28
  demo.launch(debug=True)
29
  # gr.Interface.load("models/ankush-003/nosqli_identifier").launch()