Spaces:
Sleeping
Sleeping
Update app.py
Browse filesAdded probability to the outputs.
app.py
CHANGED
@@ -12,7 +12,7 @@ import gradio as gr
|
|
12 |
|
13 |
set_random_seed(65536)
|
14 |
|
15 |
-
pandarallel.initialize(use_memory_fs=
|
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(
|