Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DEFAULT_PARAMS to base types that are configurables #771

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions garak/buffs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class Buff(Configurable):
bcp47 = None # set of languages this buff should be constrained to
active = True

DEFAULT_PARAMS = {}

def __init__(self, config_root=_config) -> None:
self._load_config(config_root)
module = self.__class__.__module__.replace("garak.buffs.", "")
Expand Down
2 changes: 2 additions & 0 deletions garak/detectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Detector(Configurable):
# we focus on LLM output for detectors
modality: dict = {"out": {"text"}}

DEFAULT_PARAMS = {}

def _set_description(self):
if "description" not in dir(self):
try:
Expand Down
2 changes: 2 additions & 0 deletions garak/harnesses/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Harness(Configurable):

active = True

DEFAULT_PARAMS = {}

def __init__(self, config_root=_config):
self._load_config(config_root)
logging.info("harness init: %s", self)
Expand Down
2 changes: 2 additions & 0 deletions garak/probes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class Probe(Configurable):
# we focus on LLM input for probe
modality: dict = {"in": {"text"}}

DEFAULT_PARAMS = {}

def __init__(self, config_root=_config):
"""Sets up a probe. This constructor:
1. populates self.probename based on the class name,
Expand Down
Loading