mirror of
https://github.com/deepspeedai/DeepSpeed.git
synced 2025-10-20 15:33:51 +08:00
Add position_ids arg to OPTEmbedding forward function (#6939)
This PR updates the DeepSpeed `OPTEmbedding` forward function to include a new `positions_ids` argument. --------- Co-authored-by: Logan Adams <loadams@microsoft.com>
This commit is contained in:
2
.github/workflows/nv-ds-chat.yml
vendored
2
.github/workflows/nv-ds-chat.yml
vendored
@ -43,7 +43,7 @@ jobs:
|
||||
|
||||
- name: Install deepspeed
|
||||
run: |
|
||||
pip install transformers==4.45.2
|
||||
pip install transformers
|
||||
pip install .[dev]
|
||||
ds_report
|
||||
|
||||
|
@ -191,7 +191,7 @@ class OPTEmbedding(EmbeddingLayer):
|
||||
self.offset = 2
|
||||
super().__init__(weight_shape, weight=weight)
|
||||
|
||||
def forward(self, attention_mask: torch.LongTensor, past_key_values_length: int = 0):
|
||||
def forward(self, attention_mask: torch.LongTensor, past_key_values_length: int = 0, position_ids: int = 0):
|
||||
"""`input_ids_shape` is expected to be [bsz x seqlen]."""
|
||||
attention_mask = attention_mask.long()
|
||||
|
||||
|
Reference in New Issue
Block a user