Fix Mindspore model import warning (#15287)
Co-authored-by: Even Zhou <even.y.zhou@outlook.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the SGLang project
|
# SPDX-FileCopyrightText: Copyright contributors to the SGLang project
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Iterable, Optional, Tuple
|
from typing import Any, Iterable, Optional, Tuple
|
||||||
|
|
||||||
@@ -133,7 +135,7 @@ class LowerTriangularMask:
|
|||||||
def gen_attention_mask(
|
def gen_attention_mask(
|
||||||
self,
|
self,
|
||||||
is_prefill: bool,
|
is_prefill: bool,
|
||||||
position_ids: Tensor,
|
position_ids: "ms.Tensor",
|
||||||
query_lens_np: np.ndarray,
|
query_lens_np: np.ndarray,
|
||||||
seq_lens_np: np.ndarray,
|
seq_lens_np: np.ndarray,
|
||||||
):
|
):
|
||||||
@@ -289,7 +291,7 @@ class MindSporeForCausalLM(torch.nn.Module):
|
|||||||
input_ids: torch.Tensor,
|
input_ids: torch.Tensor,
|
||||||
positions: torch.Tensor,
|
positions: torch.Tensor,
|
||||||
forward_batch: ForwardBatch,
|
forward_batch: ForwardBatch,
|
||||||
) -> Tensor:
|
) -> "ms.Tensor":
|
||||||
# prepare base inputs
|
# prepare base inputs
|
||||||
model_inputs = self.prepare_inputs(input_ids, positions, forward_batch)
|
model_inputs = self.prepare_inputs(input_ids, positions, forward_batch)
|
||||||
# prepare model inputs
|
# prepare model inputs
|
||||||
|
|||||||
Reference in New Issue
Block a user