-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: enable configuration updates (#1026)
- Loading branch information
Showing
13 changed files
with
442 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 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 RenameGCG(Migration): | ||
def apply(config_dict: dict) -> dict: | ||
"""Rename probe family gcg -> suffix""" | ||
|
||
path = ["plugins", "probes"] | ||
old = "gcg" | ||
new = "suffix" | ||
return _plugin.rename(config_dict, path, old, new) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 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 RenameContinuation(Migration): | ||
def apply(config_dict: dict) -> dict: | ||
"""Rename continuation probe class 80 -> Mini""" | ||
|
||
path = ["plugins", "probes", "continuation"] | ||
old = "ContinueSlursReclaimedSlurs80" | ||
new = "ContinueSlursReclaimedSlursMini" | ||
return _plugin.rename(config_dict, path, old, new) |
15 changes: 15 additions & 0 deletions
15
garak/resources/fixer/20240822_knownbadsignatures_rename.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 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 RenameKnownbadsignatures(Migration): | ||
def apply(config_dict: dict) -> dict: | ||
"""Rename probe family knownbadsignatures -> av_spam_scanning""" | ||
|
||
path = ["plugins", "probes"] | ||
old = "knownbadsignatures" | ||
new = "av_spam_scanning" | ||
return _plugin.rename(config_dict, path, old, new) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 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 RenameReplay(Migration): | ||
def apply(config_dict: dict) -> dict: | ||
"""Rename probe family replay -> divergence""" | ||
|
||
path = ["plugins", "probes"] | ||
old = "replay" | ||
new = "divergence" | ||
return _plugin.rename(config_dict, path, old, new) |
Oops, something went wrong.