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 additional error message when __doc__ is None type #566

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

DavidLee528
Copy link
Contributor

When developing a new detector, people may forget to write documentation string for the specific Python class. This will cause Exception which is relatively hard to locate the bad line.

In my case, garak told me detector load failed when developing a new prompt-based adversarial attack probe and detector pair.

e086944c33a8be5534cfac091c9e09c

In the end, I found the missing of documentation string of new PromptAttack class cause this exception.

a19bc4f6af64a3a9dfaa3ee7a4da5cf

To better develop experience, I add some error handle code there. See file changes for detail.

@erickgalinkin erickgalinkin self-requested a review March 22, 2024 13:03
Copy link
Collaborator

@erickgalinkin erickgalinkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

@erickgalinkin erickgalinkin merged commit 95552a2 into NVIDIA:main Mar 22, 2024
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2024
@leondz
Copy link
Collaborator

leondz commented Mar 22, 2024

Great, thanks! Tests will fail if docs are missing, but it's good to make this clear earlier

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants