File tree Expand file tree Collapse file tree 2 files changed +2
-18
lines changed
src/transformers/models/whisper Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -687,9 +687,9 @@ def forward(
687
687
inputs_embeds = nn .functional .gelu (self .conv2 (inputs_embeds ))
688
688
689
689
inputs_embeds = inputs_embeds .permute (0 , 2 , 1 )
690
- embed_pos = self .embed_positions .weight
690
+ all_positions = torch . arange ( self .embed_positions .num_embeddings , device = inputs_embeds . device )
691
691
692
- hidden_states = inputs_embeds + embed_pos
692
+ hidden_states = inputs_embeds + self . embed_positions ( all_positions )
693
693
hidden_states = nn .functional .dropout (hidden_states , p = self .dropout , training = self .training )
694
694
695
695
encoder_states = () if output_hidden_states else None
Original file line number Diff line number Diff line change @@ -3356,22 +3356,6 @@ def test_forward_pass_weighted_layer_sum(self):
3356
3356
config_and_inputs = self .model_tester .prepare_config_and_inputs ()
3357
3357
self .model_tester .create_and_check_model_forward (* config_and_inputs , use_weighted_layer_sum = True )
3358
3358
3359
- @unittest .skip (reason = "Some undefined behavior encountered with tiny versions of this model. Skip for now." )
3360
- def test_cpu_offload (self ):
3361
- pass
3362
-
3363
- @unittest .skip (reason = "Some undefined behavior encountered with tiny versions of this model. Skip for now." )
3364
- def test_disk_offload_bin (self ):
3365
- pass
3366
-
3367
- @unittest .skip (reason = "Some undefined behavior encountered with tiny versions of this model. Skip for now." )
3368
- def test_disk_offload_safetensors (self ):
3369
- pass
3370
-
3371
- @unittest .skip (reason = "Some undefined behavior encountered with tiny versions of this model. Skip for now." )
3372
- def test_model_parallelism (self ):
3373
- pass
3374
-
3375
3359
@unittest .skip (reason = "Not applicable for an encoder-only acoustic model" )
3376
3360
def test_inputs_embeds (self ):
3377
3361
# input embeds is meaningless for an encoder-only acoustic model
You can’t perform that action at this time.
0 commit comments