Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
prm
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZhangXiaoyun
prm
Commits
9bc550dc
Commit
9bc550dc
authored
Feb 26, 2025
by
ZhangXiaoyun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
math test
parent
ded50b3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
openr/prm/infer_fns.py
+4
-1
openr/reason/llm_service/create_service_qwen2.5_math_vllm_gold_prm.sh
+2
-1
No files found.
openr/prm/infer_fns.py
View file @
9bc550dc
...
...
@@ -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
...
...
openr/reason/llm_service/create_service_qwen2.5_math_vllm_gold_prm.sh
View file @
9bc550dc
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment