Skip to content

Commit

Permalink
Update llmfoundry/models/mpt/modeling_mpt.py
Browse files Browse the repository at this point in the history
Co-authored-by: Sasha Doubov <[email protected]>
  • Loading branch information
vchiley and sashaDoubov authored Nov 11, 2023
1 parent e740386 commit fea8f95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llmfoundry/models/mpt/modeling_mpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,9 @@ def set_input_embeddings(

def get_output_embeddings(
self) -> Union[SharedEmbedding, nn.Embedding, nn.Linear]:
return self.lm_head or self.transformer.get_input_embeddings()
if self.lm_head is not None:
return self.lm_head
return self.transformer.get_input_embeddings()

def set_output_embeddings(
self, new_embeddings: Union[SharedEmbedding, nn.Embedding,
Expand Down

0 comments on commit fea8f95

Please sign in to comment.