vllm.model_executor.models.adapters
SEQ_CLS_LOAD_METHODS module-attribute
¶
SEQ_CLS_LOAD_METHODS = {
"from_2_way_softmax": load_weights_using_from_2_way_softmax,
"no_post_processing": load_weights_no_post_processing,
}
_GENERATE_SUFFIXES module-attribute
¶
SequenceClassificationConfig ¶
Bases: VerifyAndUpdateConfig
Source code in vllm/model_executor/models/adapters.py
verify_and_update_config staticmethod
¶
verify_and_update_config(vllm_config: VllmConfig) -> None
Source code in vllm/model_executor/models/adapters.py
_create_pooling_model_cls ¶
Source code in vllm/model_executor/models/adapters.py
_get_pooling_model_name ¶
Source code in vllm/model_executor/models/adapters.py
as_embedding_model ¶
Subclass an existing vLLM model to support embeddings.
By default, the embeddings of the whole prompt are extracted from the normalized hidden state corresponding to the last token.
Note
We assume that no extra layers are added to the original model; please implement your own model if this is not the case.
Source code in vllm/model_executor/models/adapters.py
as_reward_model ¶
Subclass an existing vLLM model to support reward modeling.
By default, we return the hidden states of each token directly.
Note
We assume that no extra layers are added to the original model; please implement your own model if this is not the case.
Source code in vllm/model_executor/models/adapters.py
as_seq_cls_model ¶
Subclass an existing vLLM model to support classify and score tasks.
By default, the class probabilities are extracted from the softmaxed hidden state corresponding to the last token.
Note
We assume that the classification head is a single linear layer stored as the attribute score
of the top-level model; please implement your own model if this is not the case.
Source code in vllm/model_executor/models/adapters.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|