Skip to content

Commit cd9e961

Browse files
committed
fix
Signed-off-by: David9857 <985700846@qq.com>
1 parent ad92dee commit cd9e961

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vllm_ascend/models/qwen3.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def pad(tensor, x):
3737
return F.pad(tensor, (0, 0, 0, pad_size)), pad_size
3838
return tensor, pad_size
3939

40+
4041
def unpad(tensor, pad_size):
4142
if pad_size > 0:
4243
return tensor[:-pad_size, :]
@@ -253,7 +254,7 @@ def pre_attention_process(self, hidden_states, residual, pad_size=0):
253254
hidden_states = tensor_model_parallel_all_gather(hidden_states, 0)
254255
hidden_states = unpad(hidden_states, pad_size)
255256
return hidden_states, residual
256-
257+
257258
def pre_mlp_process(self, hidden_states, residual, pad_size=0):
258259
token_num = hidden_states.size(0)
259260
if token_num != residual.size(0):
@@ -298,7 +299,7 @@ def forward(self,
298299
hidden_states, residual)
299300
hidden_states, pad_size = self.mlp(hidden_states)
300301
return hidden_states, residual, pad_size
301-
302+
302303

303304
ALL_DECODER_LAYER_TYPES = {
304305
"attention": CustomQwen3DecoderLayer,

0 commit comments

Comments
 (0)