deathsaber93 commited on
Commit
f53dfa1
·
verified ·
1 Parent(s): 2a910b1

Update app.py

Browse files

Added probability to the outputs.

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -12,7 +12,7 @@ import gradio as gr
12
 
13
  set_random_seed(65536)
14
 
15
- pandarallel.initialize(use_memory_fs=False, nb_workers=cpu_count())
16
  model = load_model('./sqid.keras')
17
 
18
 
@@ -96,8 +96,8 @@ def is_malicious_sql(sql, threshold):
96
 
97
  preds = model.predict([input_df['Query'], x_in]).tolist()[0][0]
98
  if preds > float(threshold):
99
- return 'Malicious'
100
- return 'Safe'
101
 
102
 
103
  def respond(
 
12
 
13
  set_random_seed(65536)
14
 
15
+ pandarallel.initialize(use_memory_fs=True, nb_workers=cpu_count())
16
  model = load_model('./sqid.keras')
17
 
18
 
 
96
 
97
  preds = model.predict([input_df['Query'], x_in]).tolist()[0][0]
98
  if preds > float(threshold):
99
+ return f'Malicious - {preds}'
100
+ return f'Safe - {preds}'
101
 
102
 
103
  def respond(