[Misc] Upgrade to Python 3.9 typing for additional directories (#14492)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-03-08 17:35:50 +00:00
committed by GitHub
parent 0d5e73d30e
commit 9513290032
12 changed files with 78 additions and 78 deletions
+4 -3
View File
@@ -2,9 +2,10 @@
from abc import ABC, abstractmethod
from collections import defaultdict
from collections.abc import Sequence
from pathlib import Path
from typing import (TYPE_CHECKING, Any, Callable, Generic, NamedTuple,
Optional, Sequence, Tuple, Type, TypeVar, Union)
Optional, TypeVar, Union)
from torch import nn
@@ -39,7 +40,7 @@ model. This does not include tokens that correspond to the input text.
"""
_T = TypeVar("_T")
N = TypeVar("N", bound=Type[nn.Module])
N = TypeVar("N", bound=type[nn.Module])
class MultiModalPlugin(ABC):
@@ -274,7 +275,7 @@ class MultiModalPlaceholderMap:
@classmethod
def from_seq_group(
cls, seq_group: "SequenceGroupMetadata", positions: range
) -> Tuple[Optional[MultiModalDataDict], dict[str,
) -> tuple[Optional[MultiModalDataDict], dict[str,
"MultiModalPlaceholderMap"]]:
"""
Returns the multi-modal items that intersect with the portion of a