@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 37bfee92bf
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 16:00 UTC

fix: better error message for get_config close #13889 (#15943)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>

yihong committed Apr 3, 2025 at 11:53 UTC 37bfee92bf4159f5839d9bed6b2fb2b96db4e741
1 file changed +13 -1
vllm/transformers_utils/config.py
+13 -1
@@ -262,6 +262,11 @@ def get_config(
262 MISTRAL_CONFIG_NAME,
263 revision=revision):
264 config_format = ConfigFormat.MISTRAL
265 + else:
266 + raise ValueError(
267 + "Could not detect config format for no config file found. "
268 + "Ensure your model has either config.json (HF format) "
269 + "or params.json (Mistral format).")
270
271 except Exception as e:
272 error_message = (
@@ -324,7 +329,14 @@ def get_config(
329 elif config_format == ConfigFormat.MISTRAL:
330 config = load_params_config(model, revision, token=HF_TOKEN, **kwargs)
331 else:
327 - raise ValueError(f"Unsupported config format: {config_format}")
332 + supported_formats = [
333 + fmt.value for fmt in ConfigFormat if fmt != ConfigFormat.AUTO
334 + ]
335 + raise ValueError(
336 + f"Unsupported config format: {config_format}. "
337 + f"Supported formats are: {', '.join(supported_formats)}. "
338 + f"Ensure your model uses one of these configuration formats "
339 + f"or specify the correct format explicitly.")
340
341 # Special architecture mapping check for GGUF models
342 if is_gguf: