Skip to content

Commit

Permalink
pass run_llm_in_parallel to benchmarks
Browse files Browse the repository at this point in the history
Reviewed By: SimonWan

Differential Revision: D69662273

fbshipit-source-id: 93e109e5c851cbdb3f6772d93f76936169184630
  • Loading branch information
onionymous authored and facebook-github-bot committed Feb 14, 2025
1 parent c6dee62 commit 23156b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CybersecurityBenchmarks/benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def query_llm_to_generate_responses(
async def run(
self,
num_test_cases: int = 0,
run_llm_in_parallel: int = 1,
) -> None:
"""
Processes a LLM-response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def query_llm_to_generate_responses(

self.response_path.write_text(json.dumps(response_result, indent=4))

async def run(self, num_test_cases: int = 0) -> None: # noqa: C901
async def run(self, num_test_cases: int = 0, run_llm_in_parallel: int = 1) -> None: # noqa: C901
"""
Processes a LLM-response by checking whether the response is detected as insecure by ICD.
"""
Expand Down
2 changes: 1 addition & 1 deletion CybersecurityBenchmarks/benchmark/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def main(
)
if args.num_queries_per_prompt:
args.num_test_cases = args.num_test_cases * args.num_queries_per_prompt
asyncio.run(benchmark.run(args.num_test_cases))
asyncio.run(benchmark.run(args.num_test_cases, args.run_llm_in_parallel))


if __name__ == "__main__":
Expand Down

0 comments on commit 23156b7

Please sign in to comment.