parse.py 548 Bytes
Newer Older
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3

4
from .data import ProcessorInputs, SingletonInputs
5
6


7
8
def split_enc_dec_inputs(
    inputs: ProcessorInputs,
9
) -> tuple[SingletonInputs | None, SingletonInputs]:
10
11
12
13
14
15
16
17
    if "encoder" in inputs and "decoder" in inputs:
        # NOTE: This passes pyright but not mypy
        return (
            inputs["encoder"],  # type: ignore[typeddict-item]
            inputs["decoder"],  # type: ignore[typeddict-item]
        )

    return None, inputs