meta-llama / PurpleLlama

Set of tools to assess and improve LLM security.
Other
2.74k stars 453 forks source link

ref: replace if-else chain with dict lookup for response computation #32

Closed iw4p closed 7 months ago

iw4p commented 7 months ago

The new code won't waste time creating LLMs if none were specified, and can raise a ValueError right away.

facebook-github-bot commented 7 months ago

Hi @iw4p!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

facebook-github-bot commented 7 months ago

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

iw4p commented 7 months ago

Hi SimonWan! Sure, I will ignore the black reformatting commits and just change the if statement. Thank you.

iw4p commented 7 months ago

Hey Simon! Both raise ValueErrors for materialized_llms_under_test and args.llm_under_testhave been added. I ignored the black formatting commits too.

iw4p commented 7 months ago

Please address my comments as the current version may still raise unexpected errors. Thank you.

Hi Simon! Thank you. I skipped the old commits and handled the error checking/controlling as you asked.

facebook-github-bot commented 7 months ago

@SimonWan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 7 months ago

@SimonWan merged this pull request in meta-llama/PurpleLlama@c3afa152c737bf7fd74939ed13a51bcca483a52d.