"vllm/collect_env.py" did not exist on "3d8a5f063d8a96ccfb8fc14d1d43b93cea0411a0"
__init__.py 1.93 KB
Newer Older
1
2
3
4
5
from .data import (DecoderOnlyInputs, EncoderDecoderInputs,
                   ExplicitEncoderDecoderPrompt, PromptType, SingletonInputs,
                   SingletonPrompt, TextPrompt, TokenInputs, TokensPrompt,
                   build_explicit_enc_dec_prompt, to_enc_dec_tuple_list,
                   token_inputs, zip_enc_dec_prompts)
6
7
8
9
10
11
12
13
14
15
16
17
from .registry import InputContext, InputRegistry

INPUT_REGISTRY = InputRegistry()
"""
The global :class:`~InputRegistry` which is used by :class:`~vllm.LLMEngine`
to dispatch data processing according to the target model.

See also:
    :ref:`input_processing_pipeline`
"""

__all__ = [
18
19
    "TextPrompt",
    "TokensPrompt",
20
21
    "PromptType",
    "SingletonPrompt",
22
    "ExplicitEncoderDecoderPrompt",
23
24
25
26
27
    "TokenInputs",
    "token_inputs",
    "SingletonInputs",
    "DecoderOnlyInputs",
    "EncoderDecoderInputs",
28
29
30
    "build_explicit_enc_dec_prompt",
    "to_enc_dec_tuple_list",
    "zip_enc_dec_prompts",
31
32
33
    "INPUT_REGISTRY",
    "InputContext",
    "InputRegistry",
34
]
35
36
37


def __getattr__(name: str):
38
    import warnings
39

40
    if name == "PromptInput":
41
42
43
44
45
46
47
        msg = ("PromptInput has been renamed to PromptType. "
               "The original name will be removed in an upcoming version.")

        warnings.warn(DeprecationWarning(msg), stacklevel=2)

        return PromptType

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    if name == "LLMInputs":
        msg = ("LLMInputs has been renamed to DecoderOnlyInputs. "
               "The original name will be removed in an upcoming version.")

        warnings.warn(DeprecationWarning(msg), stacklevel=2)

        return DecoderOnlyInputs

    if name == "EncoderDecoderLLMInputs":
        msg = (
            "EncoderDecoderLLMInputs has been renamed to EncoderDecoderInputs. "
            "The original name will be removed in an upcoming version.")

        warnings.warn(DeprecationWarning(msg), stacklevel=2)

        return EncoderDecoderInputs

65
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")