@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 82bfc38d07
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 08:15 UTC

[Misc] Sort the list of embedding models (#10037)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>

Cyrus Leung committed Nov 6, 2024 at 12:05 UTC 82bfc38d079b1ef5f4b88ac7094a00029d2e99af
1 file changed +8 -18
vllm/model_executor/models/registry.py
+8 -18
@@ -94,33 +94,23 @@ _TEXT_GENERATION_MODELS = {
94 _EMBEDDING_MODELS = {
95 # [Text-only]
96 "BertModel": ("bert", "BertEmbeddingModel"),
97 + "DeciLMForCausalLM": ("decilm", "DeciLMForCausalLM"),
98 "Gemma2Model": ("gemma2", "Gemma2EmbeddingModel"),
99 "LlamaModel": ("llama", "LlamaEmbeddingModel"),
100 + **{
101 + # Multiple models share the same architecture, so we include them all
102 + k: (mod, arch) for k, (mod, arch) in _TEXT_GENERATION_MODELS.items()
103 + if arch == "LlamaForCausalLM"
104 + },
105 "MistralModel": ("llama", "LlamaEmbeddingModel"),
100 - "Qwen2ForRewardModel": ("qwen2_rm", "Qwen2ForRewardModel"),
101 - "Qwen2ForSequenceClassification": (
102 - "qwen2_cls", "Qwen2ForSequenceClassification"),
103 - "LlamaForCausalLM": ("llama", "LlamaForCausalLM"),
106 "Phi3ForCausalLM": ("phi3", "Phi3ForCausalLM"),
105 - "DeciLMForCausalLM": ("decilm", "DeciLMForCausalLM"),
107 + "Qwen2ForRewardModel": ("qwen2_rm", "Qwen2ForRewardModel"),
108 + "Qwen2ForSequenceClassification": ("qwen2_cls", "Qwen2ForSequenceClassification"), # noqa: E501
109 # [Multimodal]
110 "LlavaNextForConditionalGeneration": ("llava_next", "LlavaNextForConditionalGeneration"), # noqa: E501
111 "Phi3VForCausalLM": ("phi3v", "Phi3VForCausalLM"),
112 }
113
111 -def add_embedding_models(base_models, embedding_models):
112 - with_pooler_method_models = {}
113 - embedding_models_name = embedding_models.keys()
114 - for name, (path, arch) in base_models.items():
115 - if arch in embedding_models_name:
116 - with_pooler_method_models[name] = (path, arch)
117 - return with_pooler_method_models
118 -
119 -_EMBEDDING_MODELS = {
120 - **add_embedding_models(_TEXT_GENERATION_MODELS, _EMBEDDING_MODELS),
121 - **_EMBEDDING_MODELS,
122 -}
123 -
114 _MULTIMODAL_MODELS = {
115 # [Decoder-only]
116 "Blip2ForConditionalGeneration": ("blip2", "Blip2ForConditionalGeneration"),