Skip to content

Commit

Permalink
prefer hasattr to dir
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Martin <[email protected]>
  • Loading branch information
jmartin-tech committed Jul 30, 2024
1 parent e9be28a commit 2779ede
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion garak/generators/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __init__(self, name="", generations=10, config_root=_config):
self._load_config(config_root)
self.fullname = f"{self.generator_family_name} {self.name}"
self.key_env_var = self.ENV_VAR
if "seed" not in dir(self):
if not hasattr(self, "seed"):
self.seed = None

self._load_client()
Expand Down

0 comments on commit 2779ede

Please sign in to comment.