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

4
5
6
7
8
9
from dataclasses import dataclass


@dataclass
class AdapterMapping:
    # Per every token in input_ids:
10
    index_mapping: tuple[int, ...]
11
    # Per sampled token:
12
    prompt_mapping: tuple[int, ...]
13
14
15
16

    def __post_init__(self):
        self.index_mapping = tuple(self.index_mapping)
        self.prompt_mapping = tuple(self.prompt_mapping)