[Hardware][CPU] using current_platform.is_cpu (#9536)
This commit is contained in:
@@ -5,8 +5,8 @@ import torch
|
||||
|
||||
from vllm.config import ModelConfig, TaskOption
|
||||
from vllm.inputs import InputContext
|
||||
from vllm.platforms import current_platform
|
||||
from vllm.sequence import Logprob, PromptLogprobs, SampleLogprobs
|
||||
from vllm.utils import is_cpu
|
||||
|
||||
TokensText = Tuple[List[int], str]
|
||||
|
||||
@@ -19,7 +19,7 @@ def check_outputs_equal(
|
||||
name_1: str,
|
||||
):
|
||||
"""
|
||||
Compare the two sequences generated by different models,
|
||||
Compare the two sequences generated by different models,
|
||||
which should be equal.
|
||||
"""
|
||||
assert len(outputs_0_lst) == len(outputs_1_lst)
|
||||
@@ -255,7 +255,7 @@ def build_model_context(model_name: str,
|
||||
mm_processor_kwargs: Optional[Dict] = None,
|
||||
limit_mm_per_prompt: Optional[Dict] = None):
|
||||
"""Creates an InputContext for a given model.
|
||||
|
||||
|
||||
Args:
|
||||
model_name: Name of the model being considered.
|
||||
tokenizer_name: Name of the tokenizer being considered.
|
||||
@@ -270,7 +270,7 @@ def build_model_context(model_name: str,
|
||||
if tokenizer_name is None:
|
||||
tokenizer_name = model_name
|
||||
if dtype is None:
|
||||
dtype = "bfloat16" if is_cpu() else "half"
|
||||
dtype = "bfloat16" if current_platform.is_cpu() else "half"
|
||||
|
||||
model_config = ModelConfig(
|
||||
model_name,
|
||||
|
||||
Reference in New Issue
Block a user