Spaces:
Sleeping
Sleeping
updated the ui
Browse files- src/ui/app.py +6 -8
src/ui/app.py
CHANGED
|
@@ -40,7 +40,10 @@ def analyze_malware(file_path):
|
|
| 40 |
prob_a = result_a["malware_prob"] * 100
|
| 41 |
status_a = "Malicious" if result_a["is_malware"] else "Benign"
|
| 42 |
|
| 43 |
-
text_a =
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
# Build explainability for gr.Label
|
| 46 |
explain_dict = {}
|
|
@@ -340,14 +343,9 @@ with gr.Blocks() as app:
|
|
| 340 |
gr.Markdown("---")
|
| 341 |
|
| 342 |
# Single column layout for maximum horizontal space
|
| 343 |
-
ensemble_output = gr.Textbox(
|
| 344 |
-
|
| 345 |
-
)
|
| 346 |
-
output_a = gr.Textbox(
|
| 347 |
label="Engine A: Structural (EMBER)",
|
| 348 |
-
value="Awaiting input...",
|
| 349 |
-
interactive=False,
|
| 350 |
-
lines=2,
|
| 351 |
)
|
| 352 |
explain_plot = gr.Label(
|
| 353 |
label="Engine A: Explainability (Feature Impact)", num_top_classes=3
|
|
|
|
| 40 |
prob_a = result_a["malware_prob"] * 100
|
| 41 |
status_a = "Malicious" if result_a["is_malware"] else "Benign"
|
| 42 |
|
| 43 |
+
text_a = {
|
| 44 |
+
"Malicious": result_a["malware_prob"],
|
| 45 |
+
"Benign": 1.0 - result_a["malware_prob"],
|
| 46 |
+
}
|
| 47 |
|
| 48 |
# Build explainability for gr.Label
|
| 49 |
explain_dict = {}
|
|
|
|
| 343 |
gr.Markdown("---")
|
| 344 |
|
| 345 |
# Single column layout for maximum horizontal space
|
| 346 |
+
ensemble_output = gr.Textbox(label="Final Verdict", interactive=False, lines=1)
|
| 347 |
+
output_a = gr.Label(
|
|
|
|
|
|
|
| 348 |
label="Engine A: Structural (EMBER)",
|
|
|
|
|
|
|
|
|
|
| 349 |
)
|
| 350 |
explain_plot = gr.Label(
|
| 351 |
label="Engine A: Explainability (Feature Impact)", num_top_classes=3
|