Skip to content

Commit 8bbe242

Browse files
committed
code format
Signed-off-by: MengqingCao <cmq0113@163.com>
1 parent c774f33 commit 8bbe242

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/singlecard/test_accuracy.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626
import torch
2727

2828
# pre-trained model path on Hugging Face.
29-
MODELS = [
30-
"Qwen/Qwen2.5-0.5B-Instruct",
31-
"deepseek-ai/DeepSeek-V2-Lite"
32-
]
29+
MODELS = ["Qwen/Qwen2.5-0.5B-Instruct", "deepseek-ai/DeepSeek-V2-Lite"]
3330
# Math reasoning benchmark (Grade School Math 8K).
3431
TASK = "gsm8k"
3532
# Answer validation requiring format consistency.
@@ -39,6 +36,7 @@
3936
# Baseline accuracy after VLLM optimization.
4037
EXPECTED_VALUE = 0.316
4138

39+
4240
def run_test(model_name, queue, more_args=None):
4341
model_args = f"pretrained={model_name},max_model_len=4096,trust_remote_code=True"
4442
if more_args is not None:
@@ -61,9 +59,13 @@ def run_test(model_name, queue, more_args=None):
6159
def test_lm_eval_accuracy(model, monkeypatch: pytest.MonkeyPatch):
6260
with monkeypatch.context():
6361
result_queue: Queue[float] = multiprocessing.Queue()
64-
p = multiprocessing.Process(target=run_test, args=(model, result_queue, ))
62+
p = multiprocessing.Process(target=run_test,
63+
args=(
64+
model,
65+
result_queue,
66+
))
6567
p.start()
6668
p.join()
6769
result = result_queue.get()
6870
assert (EXPECTED_VALUE - RTOL < result < EXPECTED_VALUE + RTOL), \
69-
f"Expected: {EXPECTED_VALUE}±{RTOL} | Measured: {result}"
71+
f"Expected: {EXPECTED_VALUE}±{RTOL} | Measured: {result}"

0 commit comments

Comments
 (0)