Skip to content

Commit 37bfee9

Browse files
authored
fix: better error message for get_config close #13889 (#15943)
Signed-off-by: yihong0618 <[email protected]>
1 parent e73ff24 commit 37bfee9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

vllm/transformers_utils/config.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ def get_config(
262262
MISTRAL_CONFIG_NAME,
263263
revision=revision):
264264
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).")
265270

266271
except Exception as e:
267272
error_message = (
@@ -324,7 +329,14 @@ def get_config(
324329
elif config_format == ConfigFormat.MISTRAL:
325330
config = load_params_config(model, revision, token=HF_TOKEN, **kwargs)
326331
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.")
328340

329341
# Special architecture mapping check for GGUF models
330342
if is_gguf:

0 commit comments

Comments
 (0)