Skip to content

Commit

Permalink
tiny fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed May 28, 2023
1 parent 7fc792d commit a09bb2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def ppo_train(self, max_target_length: int) -> None:

stats = self.step(queries, responses, rewards)

loss_meter.update(stats["ppo/loss/total"])
reward_meter.update(torch.tensor(rewards).sum().item(), n=len(rewards))
loss_meter.update(stats["ppo/loss/total"], n=len(rewards))
reward_meter.update(torch.stack(rewards).mean().item(), n=len(rewards))

if steps_trained == len_dataloader:
dataiter = iter(self.dataloader)
Expand Down

0 comments on commit a09bb2d

Please sign in to comment.