__init__.py 2 KB
Newer Older
1
from .data import (DecoderOnlyInputs, EncoderDecoderInputs,
2
3
4
5
                   ExplicitEncoderDecoderPrompt, ProcessorInputs, PromptType,
                   SingletonInputs, SingletonPrompt, TextPrompt, TokenInputs,
                   TokensPrompt, build_explicit_enc_dec_prompt,
                   to_enc_dec_tuple_list, token_inputs, zip_enc_dec_prompts)
6
from .registry import DummyData, InputContext, InputRegistry
7
8
9
10
11
12
13
14
15
16
17

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
    "TokenInputs",
    "token_inputs",
    "DecoderOnlyInputs",
    "EncoderDecoderInputs",
27
28
    "ProcessorInputs",
    "SingletonInputs",
29
30
31
    "build_explicit_enc_dec_prompt",
    "to_enc_dec_tuple_list",
    "zip_enc_dec_prompts",
32
    "INPUT_REGISTRY",
33
    "DummyData",
34
35
    "InputContext",
    "InputRegistry",
36
]
37
38
39


def __getattr__(name: str):
40
    import warnings
41

42
    if name == "PromptInput":
43
44
45
46
47
48
49
        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

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    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

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