[Misc] Move utils to avoid conflicts with stdlib, and move tests (#27169)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -22,7 +22,7 @@ from typing import (
|
||||
import numpy as np
|
||||
from typing_extensions import NotRequired, TypeVar, deprecated
|
||||
|
||||
from vllm.utils.collections import full_groupby, is_list_of
|
||||
from vllm.utils.collection_utils import full_groupby, is_list_of
|
||||
from vllm.utils.import_utils import LazyLoader
|
||||
from vllm.utils.jsontree import json_map_leaves
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import numpy as np
|
||||
import torch
|
||||
from typing_extensions import assert_never
|
||||
|
||||
from vllm.utils.collections import is_list_of
|
||||
from vllm.utils.collection_utils import is_list_of
|
||||
from vllm.utils.import_utils import LazyLoader
|
||||
|
||||
from .audio import AudioResampler
|
||||
|
||||
@@ -25,8 +25,8 @@ from typing_extensions import TypeVar, assert_never
|
||||
from vllm.logger import init_logger
|
||||
from vllm.transformers_utils.processor import cached_processor_from_config
|
||||
from vllm.transformers_utils.tokenizer import AnyTokenizer, decode_tokens, encode_tokens
|
||||
from vllm.utils.collections import flatten_2d_lists, full_groupby
|
||||
from vllm.utils.functools import get_allowed_kwarg_only_overrides
|
||||
from vllm.utils.collection_utils import flatten_2d_lists, full_groupby
|
||||
from vllm.utils.func_utils import get_allowed_kwarg_only_overrides
|
||||
from vllm.utils.jsontree import JSONTree, json_map_leaves
|
||||
|
||||
from .hasher import MultiModalHasher
|
||||
@@ -486,7 +486,7 @@ _M = TypeVar("_M", bound=_HasModalityAttr | _HasModalityProp)
|
||||
def full_groupby_modality(values: Iterable[_M]) -> ItemsView[str, list[_M]]:
|
||||
"""
|
||||
Convenience function to apply
|
||||
[`full_groupby`][vllm.utils.collections.full_groupby]
|
||||
[`full_groupby`][vllm.utils.collection_utils.full_groupby]
|
||||
based on modality.
|
||||
"""
|
||||
return full_groupby(values, key=lambda x: x.modality)
|
||||
|
||||
@@ -9,7 +9,7 @@ import torch.nn as nn
|
||||
from vllm.config.multimodal import BaseDummyOptions
|
||||
from vllm.logger import init_logger
|
||||
from vllm.transformers_utils.tokenizer import AnyTokenizer, cached_tokenizer_from_config
|
||||
from vllm.utils.collections import ClassRegistry
|
||||
from vllm.utils.collection_utils import ClassRegistry
|
||||
|
||||
from .cache import BaseMultiModalProcessorCache
|
||||
from .processing import (
|
||||
|
||||
Reference in New Issue
Block a user