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
708b9eee
Commit
708b9eee
authored
Feb 28, 2025
by
ZhangXiaoyun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cancel rollout
parent
d4c74075
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
openr/prm/infer_fns.py
+9
-1
No files found.
openr/prm/infer_fns.py
View file @
708b9eee
...
...
@@ -98,8 +98,10 @@ def _qwen_math_gold_infer_fn(input_str: str, model, tokenizer, device, acc):
# "stop_token_ids": [151643, 151643],
}
sampling_params
=
SamplingParams
(
**
inference_params
)
step_scores
=
[]
# 从redis中获取所有已经计算过的step_score
step_scores
=
[]
for
i
in
range
(
len
(
inputs
)):
step_score
=
get_shared_value
(
inputs
[
i
])
if
step_score
is
None
:
...
...
@@ -112,6 +114,12 @@ def _qwen_math_gold_infer_fn(input_str: str, model, tokenizer, device, acc):
inputs
=
inputs
[
len
(
step_scores
):]
# 如果前序是0,那就不用再rollout了
if
len
(
step_scores
)
!=
0
and
step_scores
[
-
1
]
==
0
:
step_scores
.
extend
([
0
]
*
(
len
(
inputs
)
-
len
(
step_scores
)))
return
step_scores
global
lock
with
lock
:
outputs
=
model
.
generate
(
inputs
,
sampling_params
)
...
...
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