Skip to content

Commit

Permalink
Make long_replies ban the eos token as well
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga committed Aug 2, 2023
1 parent 9ae0eab commit 6c521ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/long_replies/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self):
def __call__(self, input_ids, scores):
if input_ids.shape[-1] - initial_size < params["min_length"]:
scores[...,self.newline_id] = -1000
# scores[...,shared.tokenizer.eos_token_id] = -1000
scores[...,shared.tokenizer.eos_token_id] = -1000

# probs = torch.softmax(scores, dim=-1, dtype=torch.float)
# probs[0] /= probs[0].sum()
Expand Down

0 comments on commit 6c521ce

Please sign in to comment.