Skip to content

Commit caa1dc5

Browse files
committed
Fix docs build 2
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
1 parent 4397de9 commit caa1dc5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

vllm/config.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@
4343
from vllm.transformers_utils.s3_utils import S3Model
4444
from vllm.transformers_utils.utils import is_s3, maybe_model_redirect
4545
from vllm.utils import (GiB_bytes, LayerBlockType, cuda_device_count_stateless,
46-
get_cpu_memory, get_open_port, is_torch_equal_or_newer,
47-
random_uuid, resolve_obj_by_qualname)
46+
get_cpu_memory, get_open_port, is_in_doc_build,
47+
is_torch_equal_or_newer, random_uuid,
48+
resolve_obj_by_qualname)
49+
50+
IS_IN_DOC_BUILD = is_in_doc_build()
4851

4952
if TYPE_CHECKING:
5053
from _typeshed import DataclassInstance
@@ -2207,7 +2210,9 @@ def compute_hash(self) -> str:
22072210
return hash_str
22082211

22092212
def __post_init__(self):
2210-
if self.device == "auto":
2213+
if IS_IN_DOC_BUILD:
2214+
self.device_type = "cpu"
2215+
elif self.device == "auto":
22112216
# Automated device type detection
22122217
from vllm.platforms import current_platform
22132218
self.device_type = current_platform.device_type

0 commit comments

Comments
 (0)