Skip to content

Commit

Permalink
off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwh committed Nov 15, 2024
1 parent 3040956 commit c7c5f70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/gpt2_nano_harness.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trainer:
save_interval: 5m

per_device_parallelism: -1
train_batch_size: 32
train_batch_size: 4

tensor_parallel_axes: ["mlp", "heads"]
fsdp_axis: "embed"
Expand Down
2 changes: 1 addition & 1 deletion src/levanter/models/lm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def from_prompt_and_completion(
all_causal: bool = True,
) -> "LmExample":
# mask out the prompt tokens
loss_mask = hax.arange(Pos) >= prompt_length
loss_mask = hax.arange(Pos) >= prompt_length - 1
# also mask out the last token
loss_mask *= 1 - hax.nn.one_hot(-1, Pos, dtype=jnp.float32)

Expand Down

0 comments on commit c7c5f70

Please sign in to comment.