Skip to content

Commit

Permalink
using self.shift_labels instead of self.model.transformer.shift_label…
Browse files Browse the repository at this point in the history
…s in loss (#1211)

Co-authored-by: Daniel King <[email protected]>
  • Loading branch information
ShashankMosaicML and dakinggg authored May 15, 2024
1 parent cfee4e4 commit 8cd23d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llmfoundry/models/mpt/modeling_mpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ def forward(self, batch: MutableMapping) -> CausalLMOutputWithPast:

def loss(self, outputs: CausalLMOutputWithPast,
batch: Mapping) -> Union[dict, torch.Tensor]:
if self.model.transformer.shift_labels:
if self.shift_labels:
targets = self.get_targets(batch)
else:
targets = batch['labels']
Expand Down

0 comments on commit 8cd23d5

Please sign in to comment.