Commit 9bc550dc by ZhangXiaoyun

math test

parent ded50b3e
......@@ -4,6 +4,7 @@ from vllm import LLM, SamplingParams
import re
import json
from envs.MATH import extract_answer, extract_groundtruth, judge_correct
import random
question_item_map = {}
with open("./envs/MATH/dataset/test500.jsonl", encoding="utf-8") as f:
......@@ -85,7 +86,9 @@ def _qwen_math_gold_infer_fn(input_str: str, model, tokenizer, device, acc):
step_score = 1
break
# math verify
# invers
if random.random() > acc:
step_score = 1 - step_score
step_scores.append(step_score)
return step_scores
......
......@@ -3,6 +3,7 @@ set -e
HOST_ADDR=0.0.0.0
CONTROLER_PORT=28777
WORKER_BASE_PORT=30010
ACC=1.0
echo PYTHON_EXECUTABLE=$(which python3)
PYTHON_EXECUTABLE=$(which python3)
......@@ -45,5 +46,5 @@ do
WORKER_PORT=$((i+WORKER_BASE_PORT+NUM_LM_WORKER))
tmux new-window -n value_worker
tmux send-keys "export LOGDIR=${LOGDIR}" Enter
tmux send-keys "CUDA_VISIBLE_DEVICES=$((i+NUM_LM_WORKER+CUDA_DEVICE_BASE)) $PYTHON_EXECUTABLE -m reason.llm_service.workers.gold_reward_model_worker --model-path $VALUE_MODEL_PATH --controller-address http://$HOST_ADDR:$CONTROLER_PORT --host $HOST_ADDR --port $WORKER_PORT --worker-address http://$HOST_ADDR:$WORKER_PORT" Enter
tmux send-keys "CUDA_VISIBLE_DEVICES=$((i+NUM_LM_WORKER+CUDA_DEVICE_BASE)) $PYTHON_EXECUTABLE -m reason.llm_service.workers.gold_reward_model_worker --model-path $VALUE_MODEL_PATH --controller-address http://$HOST_ADDR:$CONTROLER_PORT --host $HOST_ADDR --port $WORKER_PORT --worker-address http://$HOST_ADDR:$WORKER_PORT --acc $ACC" Enter
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment