Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion vllm/entrypoints/score_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
ChatCompletionContentPartImageParam, ChatCompletionContentPartTextParam,
MultiModalItemTracker, _ContentPart, _parse_chat_message_content_part)
from vllm.inputs import TokensPrompt
from vllm.model_executor.model_loader import get_model_cls
from vllm.model_executor.models.interfaces import supports_score_template
from vllm.multimodal.inputs import MultiModalDataDict
from vllm.outputs import PoolingRequestOutput
Expand Down Expand Up @@ -140,6 +139,8 @@ def apply_score_template(
prompt_1: str,
prompt_2: str,
) -> str:
# NOTE(Simon): lazy import to avoid bring in all dependencies (e.g. gguf)
from vllm.model_executor.model_loader import get_model_cls

model = get_model_cls(model_config)
if supports_score_template(model):
Expand All @@ -162,6 +163,9 @@ def post_process_tokens(
Note:
This is an in-place operation.
"""
# NOTE(Simon): lazy import to avoid bring in all dependencies (e.g. gguf)
from vllm.model_executor.model_loader import get_model_cls

model = get_model_cls(model_config)
if supports_score_template(model):
model.post_process_tokens(prompt)
Expand Down
6 changes: 5 additions & 1 deletion vllm/model_executor/model_loader/weight_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from typing import Any, Callable, Optional, Union

import filelock
import gguf
import huggingface_hub.constants
import numpy as np
import torch
Expand All @@ -40,6 +39,11 @@
SafetensorsStreamer = runai_model_streamer.placeholder_attr(
"SafetensorsStreamer")

try:
import gguf
except ImportError:
gguf = PlaceholderModule("gguf")

try:
from fastsafetensors import SafeTensorsFileLoader, SingleGroup
except ImportError:
Expand Down