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

fix initialization bug for kwargs in function #827

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

soumilinandi
Copy link
Contributor

@soumilinandi soumilinandi commented Aug 14, 2024

Generator.function does not define self.kwargs when we don't pass that argument progamatically in function.Single.

To reproduce this error, invoke garak's cli like below

from garak.cli import main as garak_main
from typing import List

def generate_text(
) -> List[str]:
    return "empty str"


def main():
    args = [
        "-m",
        "function.Single",
        "-n",
        f"{__name__}#generate_text",
        "-p",
        "test.Blank"
    ]
    garak_main(args)

if __name__ == "__main__":
    main()

Offered fix resolves this issue.

Copy link
Contributor

github-actions bot commented Aug 14, 2024

DCO Assistant Lite bot All contributors have signed the DCO ✍️ ✅

@soumilinandi
Copy link
Contributor Author

I have read the DCO Document and I hereby sign the DCO

@soumilinandi
Copy link
Contributor Author

recheck

github-actions bot added a commit that referenced this pull request Aug 14, 2024
@leondz
Copy link
Collaborator

leondz commented Aug 14, 2024

thank you! will take a look

@jmartin-tech
Copy link
Collaborator

This is a confirmed issue introduced by #711, when attempting to account for restricted parameter names.

Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

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

Can we get a test class added that implements the example in the description?

@jmartin-tech
Copy link
Collaborator

jmartin-tech commented Aug 14, 2024

Looks like the commit messages are missing the sign-off please adjust to ensure the branch is compliant with the DCO.

soumilinandi pushed a commit to soumilinandi/garak that referenced this pull request Aug 14, 2024
@jmartin-tech jmartin-tech merged commit 411ebd7 into NVIDIA:main Aug 14, 2024
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2024
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