e-eeeema commited on
Commit
05644bb
·
verified ·
1 Parent(s): 88c3ea9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -18,7 +18,9 @@ def predict():
18
  # Apply threshold 0.3
19
  prediction = int(probs[0] > 0.3)
20
 
21
- return jsonify({'attack_detected': prediction})
 
 
22
 
23
  if __name__ == '__main__':
24
  app.run(host='0.0.0.0', port=7860)
 
18
  # Apply threshold 0.3
19
  prediction = int(probs[0] > 0.3)
20
 
21
+ return jsonify({'attack_detected': prediction,
22
+ 'probability': float(probs[0])
23
+ })
24
 
25
  if __name__ == '__main__':
26
  app.run(host='0.0.0.0', port=7860)