Skip to content

Commit

Permalink
in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
syrn1k committed Oct 19, 2024
1 parent a7ed269 commit f5a7d1d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion turbo_alignment/common/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def get_global_mean(values: torch.Tensor) -> float:
# Calculate the mean reward for the current process
local_sum = values.sum().item()

print("WORLD SIZE 😼: ", world_size)
if world_size == 1:
return values.mean().item()

Expand Down
5 changes: 0 additions & 5 deletions turbo_alignment/trainers/online/reinforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,6 @@ def get_logprobs(

def fill_nonvalid_rewards(self, rewards, query_response) -> Tuple[torch.Tensor, torch.Tensor]:
if self.args.non_eos_penalty:
assert torch.all(query_response[:, -1] != self.tokenizer.pad_token_id), (
query_response[:, -1],
self.tokenizer.pad_token_id,
)

invalid_mask = query_response[:, -1] != self.stop_generation_token_id[0]
rewards[invalid_mask] = self.args.penalty_reward_value

Expand Down

0 comments on commit f5a7d1d

Please sign in to comment.