Skip to content

Commit 492215c

Browse files
authored
Fix async training error in last rollout (THUDM#452)
1 parent 41b03ce commit 492215c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

train_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def train(args):
5353

5454
if (rollout_id + 1) % args.update_weights_interval == 0:
5555
# sync generate before update weights to prevent update weight in the middle of generation
56-
rollout_data_curr_ref = ray.get(rollout_data_next_future)
56+
rollout_data_curr_ref = ray.get(x) if (x := rollout_data_next_future) is not None else None
5757
rollout_data_next_future = None
5858
actor_model.update_weights()
5959

0 commit comments

Comments
 (0)