Skip to content

Commit 994dad5

Browse files
helena-intelAkshat-Tripathi
authored andcommitted
[Bugfix] Fix boolean conversion for OpenVINO env variable (vllm-project#13615)
1 parent 886189b commit 994dad5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

vllm/envs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,9 @@ def maybe_convert_int(value: Optional[str]) -> Optional[int]:
360360
# Enables weights compression during model export via HF Optimum
361361
# default is False
362362
"VLLM_OPENVINO_ENABLE_QUANTIZED_WEIGHTS":
363-
lambda: bool(os.getenv("VLLM_OPENVINO_ENABLE_QUANTIZED_WEIGHTS", False)),
364-
363+
lambda:
364+
(os.environ.get("VLLM_OPENVINO_ENABLE_QUANTIZED_WEIGHTS", "0").lower() in
365+
("on", "true", "1")),
365366
# If the env var is set, then all workers will execute as separate
366367
# processes from the engine, and we use the same mechanism to trigger
367368
# execution on all workers.

vllm/model_executor/model_loader/openvino.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def __init__(
125125
"as-is, all possible options that may affect model conversion "
126126
"are ignored.")
127127

128-
load_in_8bit = envs.VLLM_OPENVINO_ENABLE_QUANTIZED_WEIGHTS
128+
load_in_8bit = (envs.VLLM_OPENVINO_ENABLE_QUANTIZED_WEIGHTS
129+
if export else False)
129130
pt_model = OVModelForCausalLM.from_pretrained(
130131
model_config.model,
131132
export=export,

0 commit comments

Comments
 (0)