__init__.py 1.96 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
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
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
    "INPUT_REGISTRY",
32
    "DummyData",
33
34
    "InputContext",
    "InputRegistry",
35
]
36
37
38


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

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

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

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