Spaces:
Sleeping
Sleeping
fix: keep benign controls outside attack category selection
Browse files199 unmodified lines200201202203203204205206152 unmodified lines359360361362362363364365366367368369370371199 unmodified lines if tools_json is not None and not isinstance(tools_json, str): return "Tool definitions must be JSON text.", "", None categories = categories or [] known = {sample["attack_category"] for sample in DATASET} known = {sample["attack_category"] for sample in DATASET if sample["ground_truth"] == "unsafe"} if not isinstance(categories, list) or any( not isinstance(category, str) or category not in known for category in categories ):152 unmodified lines label="Total cases (attacks + benign controls)", ) category_select = gr.CheckboxGroup( choices=[category for category in categories if category != "benign_control"], choices=sorted( { sample["attack_category"] for sample in DATASET if sample["ground_truth"] == "unsafe" } ), label="Attack categories (controls included automatically)", )
app.py+8-2