"vscode:/vscode.git/clone" did not exist on "3ab7f0ef7780f9a501c076dbb7573c16d34ff36f"
__init__.py 2.15 KB
Newer Older
1
from .data import (DecoderOnlyInputs, EncoderDecoderInputs,
2
                   ExplicitEncoderDecoderPrompt, ProcessorInputs, PromptType,
3
4
5
6
7
8
                   SingletonInputs, SingletonInputsAdapter, SingletonPrompt,
                   TextPrompt, TokenInputs, TokensPrompt,
                   build_explicit_enc_dec_prompt, to_enc_dec_tuple_list,
                   token_inputs, zip_enc_dec_prompts)
from .registry import (DummyData, InputContext, InputProcessingContext,
                       InputRegistry)
9
10
11
12
13
14
15
16
17
18
19

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__ = [
20
21
    "TextPrompt",
    "TokensPrompt",
22
23
    "PromptType",
    "SingletonPrompt",
24
    "ExplicitEncoderDecoderPrompt",
25
26
27
28
    "TokenInputs",
    "token_inputs",
    "DecoderOnlyInputs",
    "EncoderDecoderInputs",
29
30
    "ProcessorInputs",
    "SingletonInputs",
31
    "SingletonInputsAdapter",
32
33
34
    "build_explicit_enc_dec_prompt",
    "to_enc_dec_tuple_list",
    "zip_enc_dec_prompts",
35
    "INPUT_REGISTRY",
36
    "DummyData",
37
    "InputContext",
38
    "InputProcessingContext",
39
    "InputRegistry",
40
]
41
42
43


def __getattr__(name: str):
44
    import warnings
45

46
    if name == "PromptInput":
47
48
49
50
51
52
53
        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

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
    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

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