1414 model_validator )
1515from pydantic .dataclasses import dataclass
1616from safetensors .torch import _TYPES as _SAFETENSORS_TO_TORCH_DTYPE
17- from typing_extensions import assert_never
1817
1918import vllm .envs as envs
2019from vllm .config .multimodal import (MMCacheType , MMEncoderTPMode ,
@@ -534,9 +533,6 @@ def _task_to_convert(task: TaskOption) -> ConvertType:
534533 f"You can pass `--convert { convert_option } to adapt "
535534 "it into a pooling model." )
536535
537- self .supported_tasks = self ._get_supported_tasks (
538- architectures , self .runner_type , self .convert_type )
539-
540536 # Note: Initialize these attributes early because transformers fallback
541537 # may fail to load dynamic modules in child processes
542538 model_info , arch = registry .inspect_model_cls (architectures , self )
@@ -834,27 +830,6 @@ def _get_convert_type(
834830
835831 return convert_type
836832
837- def _get_supported_generation_tasks (
838- self ,
839- architectures : list [str ],
840- convert_type : ConvertType ,
841- ) -> list [_ResolvedTask ]:
842- registry = self .registry
843-
844- if registry .is_transcription_only_model (architectures , self ):
845- return ["transcription" ]
846-
847- # TODO: Use get_supported_generation_tasks once V0 is removed
848- supported_tasks = list [_ResolvedTask ]()
849- if (registry .is_text_generation_model (architectures , self )
850- or convert_type in _RUNNER_CONVERTS ["generate" ]):
851- supported_tasks .append ("generate" )
852-
853- if registry .is_transcription_model (architectures , self ):
854- supported_tasks .append ("transcription" )
855-
856- return supported_tasks
857-
858833 def _get_default_pooling_task (
859834 self ,
860835 architectures : list [str ],
@@ -872,42 +847,6 @@ def _get_default_pooling_task(
872847
873848 return "embed"
874849
875- def _get_supported_pooling_tasks (
876- self ,
877- architectures : list [str ],
878- convert_type : ConvertType ,
879- ) -> list [_ResolvedTask ]:
880- registry = self .registry
881-
882- # TODO: Use get_supported_pooling_tasks once V0 is removed
883- supported_tasks = list [_ResolvedTask ]()
884- if (registry .is_pooling_model (architectures , self )
885- or convert_type in _RUNNER_CONVERTS ["pooling" ]):
886- supported_tasks .append ("encode" )
887-
888- extra_task = (self ._get_default_pooling_task (architectures )
889- if convert_type == "none" else convert_type )
890- supported_tasks .append (extra_task )
891-
892- return supported_tasks
893-
894- def _get_supported_tasks (
895- self ,
896- architectures : list [str ],
897- runner_type : RunnerType ,
898- convert_type : ConvertType ,
899- ) -> list [_ResolvedTask ]:
900- if runner_type == "generate" :
901- return self ._get_supported_generation_tasks (
902- architectures , convert_type )
903- if runner_type == "pooling" :
904- return self ._get_supported_pooling_tasks (architectures ,
905- convert_type )
906- if runner_type == "draft" :
907- return ["draft" ]
908-
909- assert_never (runner_type )
910-
911850 def _parse_quant_hf_config (self , hf_config : PretrainedConfig ):
912851 quant_cfg = getattr (hf_config , "quantization_config" , None )
913852 if quant_cfg is None :
0 commit comments