Skip to content

Commit 76f471e

Browse files
authored
[bugfix] remove response before filter encoded failed data (#6315)
1 parent 8472da8 commit 76f471e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

swift/trainers/rlhf_trainer/grpo_trainer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,7 @@ def resample_encode_failed_inputs(self, inputs: DataType, n_try_fetch: int = 10)
15281528
while True:
15291529
try:
15301530
# Attempt to encode the current sample.
1531+
remove_response(current_data['messages'])
15311532
template.encode(current_data)
15321533
# If successful, store the result and update the last valid data.
15331534
inputs[i] = current_data

0 commit comments

Comments
 (0)