Skip to content

Commit 70a070f

Browse files
Just-do-stzeyu-zh
authored andcommitted
Update README with dynamic evaluation command and fix potential bug
1 parent 84fac2f commit 70a070f

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ For more configuration information, please refer to `config.ini` and `.env.examp
160160

161161
Supports dynamic evaluation to verify the secure programming capabilities of Large Language Models (LLMs) in the `instruct` scenario. To start it:
162162
```Python3
163-
uv run -m sec_code_bench.eval_dynamic \
163+
uv run sec_code_bench/eval_dynamic \
164164
--benchlanguage java \
165165
--benchmark ./datasets/runnable/benchmark/java/java.json \
166166
--llm-under-test "OPENAI::<ModelName>::<APIKey>::<URL>"

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ $ uv run sec_code_bench/eval_static.py --help
158158

159159
支持通过动态运行,验证大语言模型(LLM)在 `instruct` 场景下的安全编程能力。启动方法如下:
160160
```Python3
161-
uv run -m sec_code_bench.eval_dynamic \
161+
uv run sec_code_bench/eval_dynamic \
162162
--benchlanguage java \
163163
--benchmark ./datasets/runnable/benchmark/java/java.json \
164164
--llm-under-test "OPENAI::<ModelName>::<APIKey>::<URL>"

sec_code_bench/eval_dynamic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ async def main():
215215
return 1
216216

217217
current_dir = os.path.dirname(os.path.abspath(__file__))
218-
testcases_paths = [f"{current_dir}/../datasets/runnable/benchmark/{case.get("language")}"
219-
f"/prompts/{case.get("prompt")}.{LOCALE}" for case in data]
218+
testcases_paths = [f"{current_dir}/../datasets/runnable/benchmark/{case.get('language')}"
219+
f"/prompts/{case.get('prompt')}.{LOCALE}" for case in data]
220220

221221
testcases_prompts = await get_contents_async(testcases_paths)
222222

sec_code_bench/llms/openai.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def __init__(self, config: LLMConfig, rate_limiter: AsyncRateLimiter) -> None:
4040
self.aclient = openai.AsyncOpenAI(
4141
api_key=self.api_key,
4242
base_url=self.url,
43+
max_retries=0,
4344
)
4445
self.rate_limiter = rate_limiter
4546
@override

0 commit comments

Comments
 (0)