Skip to content

Commit

Permalink
add fixer for recent renames
Browse files Browse the repository at this point in the history
  • Loading branch information
leondz committed Feb 20, 2025
1 parent da8b8d9 commit 5e33a5c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions garak/resources/fixer/20250220_unsafe_content_rename.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: Portions Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

from garak.resources.fixer import Migration
from garak.resources.fixer import _plugin


class RenameRiskywords(Migration):
def apply(config_dict: dict) -> dict:
"""Rename probe family gcg -> suffix"""

path = ["plugins", "probes"]
old = "riskywords"
new = "unsafe_content"
return _plugin.rename(config_dict, path, old, new)


class RenameToxicity(Migration):
def apply(config_dict: dict) -> dict:
"""Rename probe family gcg -> suffix"""

path = ["plugins", "probes"]
old = "toxicity"
new = "unsafe_content"
return _plugin.rename(config_dict, path, old, new)

0 comments on commit 5e33a5c

Please sign in to comment.