Skip to content

Commit 62ed628

Browse files
committed
fix dict type
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
1 parent 0d59e18 commit 62ed628

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

vllm_ascend/spec_decode/mtp_proposer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import types
2-
from typing import Dict
32

43
import torch
54
import torch.nn as nn
@@ -187,7 +186,7 @@ def generate_token_ids(self,
187186
hidden_states: torch.Tensor = None,
188187
attn_metadata=None,
189188
aux_hidden_states: torch.Tensor = None):
190-
if attn_metadata is not None and isinstance(attn_metadata, Dict):
189+
if attn_metadata is not None and isinstance(attn_metadata, dict):
191190
attn_metadata = attn_metadata['model.layers.0.self_attn.attn']
192191
next_token_ids: list[int] = []
193192
for i, token_ids in enumerate(valid_sampled_token_ids):

vllm_ascend/torchair/torchair_model_runner.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import math
2121
import types
22-
from typing import Optional, Dict
2322

2423
import torch
2524
import torch.distributed as dist
@@ -135,7 +134,7 @@ def _generate_dummy_run_hidden_states(self, with_prefill,
135134
is_torchair_compile, input_ids,
136135
positions, attn_metadata, num_tokens,
137136
intermediate_tensors, inputs_embeds):
138-
if attn_metadata is not None and isinstance(attn_metadata, Dict):
137+
if attn_metadata is not None and isinstance(attn_metadata, dict):
139138
attn_metadata = attn_metadata['model.layers.0.self_attn.attn']
140139
if not with_prefill:
141140
# Only mark static while compiling
@@ -282,7 +281,7 @@ def _generate_process_reqs_hidden_states(self, attn_metadata, with_prefill,
282281
input_ids, positions,
283282
intermediate_tensors,
284283
inputs_embeds):
285-
if attn_metadata is not None and isinstance(attn_metadata, Dict):
284+
if attn_metadata is not None and isinstance(attn_metadata, dict):
286285
attn_metadata = attn_metadata['model.layers.0.self_attn.attn']
287286
model_kwargs = {
288287
"kv_caches": self.kv_caches,

0 commit comments

Comments
 (0)