This commit is contained in:
Lianmin Zheng
2025-08-09 13:33:42 -07:00
committed by GitHub
parent 41d71ca488
commit 9a44b643c6
9 changed files with 24 additions and 20 deletions

View File

@@ -26,8 +26,9 @@ try:
from vllm.model_executor.layers.quantization.tpu_int8 import Int8TpuConfig
VLLM_AVAILABLE = True
except ImportError:
except ImportError as e:
VLLM_AVAILABLE = False
VLLM_IMPORT_ERROR = e
# Define empty classes as placeholders when vllm is not available
class DummyConfig:
@@ -137,7 +138,8 @@ def get_quantization_config(quantization: str) -> Type[QuantizationConfig]:
if quantization in VLLM_QUANTIZATION_METHODS and not VLLM_AVAILABLE:
raise ValueError(
f"{quantization} quantization requires some operators from vllm. "
"Please install vllm by `pip install vllm==0.9.0.1`"
f"Please install vllm by `pip install vllm==0.9.0.1`\n"
f"Import error: {VLLM_IMPORT_ERROR}"
)
return QUANTIZATION_METHODS[quantization]