Spaces:
Runtime error
Runtime error
ankush-003
commited on
Commit
•
282d4bf
1
Parent(s):
269fec5
Update app.py
Browse files
app.py
CHANGED
@@ -22,15 +22,15 @@ def predict(username, pwd, label, payload_text = None):
|
|
22 |
predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])
|
23 |
# print(model.config.id2label[predicted_class_id])
|
24 |
|
25 |
-
return model.config.id2label[predicted_class_id]
|
26 |
|
27 |
input_elements = [gr.Textbox(label="Enter Username"), gr.Textbox(label="Enter Password"), gr.Dropdown(["Malitious", "Benign"], label="Expected", info="Enter expected value"),
|
28 |
-
gr.Textbox(label="Enter Payload
|
29 |
|
30 |
demo = gr.Interface(
|
31 |
fn=predict,
|
32 |
inputs=input_elements,
|
33 |
-
outputs=[gr.Textbox(label="Model Prediction")]
|
34 |
)
|
35 |
demo.launch(debug=True)
|
36 |
# gr.Interface.load("models/ankush-003/nosqli_identifier").launch()
|
|
|
22 |
predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])
|
23 |
# print(model.config.id2label[predicted_class_id])
|
24 |
|
25 |
+
return model.config.id2label[predicted_class_id], payload_text
|
26 |
|
27 |
input_elements = [gr.Textbox(label="Enter Username"), gr.Textbox(label="Enter Password"), gr.Dropdown(["Malitious", "Benign"], label="Expected", info="Enter expected value"),
|
28 |
+
gr.Textbox(label="Enter Payload", info="Optional if username and password entered already")]
|
29 |
|
30 |
demo = gr.Interface(
|
31 |
fn=predict,
|
32 |
inputs=input_elements,
|
33 |
+
outputs=[gr.Textbox(label="Generated Payload"), gr.Textbox(label="Model Prediction")]
|
34 |
)
|
35 |
demo.launch(debug=True)
|
36 |
# gr.Interface.load("models/ankush-003/nosqli_identifier").launch()
|