mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-13 23:55:44 +08:00
[Misc]Clarify Error Handling for Non-existent Model Paths and HF Repo IDs (#13724)
Signed-off-by: Chen-0210 <chenjincong11@gmail.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
This commit is contained in:
parent
37b6cb4985
commit
32c3b6bfd1
@ -253,14 +253,28 @@ def get_config(
|
|||||||
model = Path(model).parent
|
model = Path(model).parent
|
||||||
|
|
||||||
if config_format == ConfigFormat.AUTO:
|
if config_format == ConfigFormat.AUTO:
|
||||||
if is_gguf or file_or_path_exists(
|
try:
|
||||||
model, HF_CONFIG_NAME, revision=revision):
|
if is_gguf or file_or_path_exists(
|
||||||
config_format = ConfigFormat.HF
|
model, HF_CONFIG_NAME, revision=revision):
|
||||||
elif file_or_path_exists(model, MISTRAL_CONFIG_NAME,
|
config_format = ConfigFormat.HF
|
||||||
revision=revision):
|
elif file_or_path_exists(model,
|
||||||
config_format = ConfigFormat.MISTRAL
|
MISTRAL_CONFIG_NAME,
|
||||||
else:
|
revision=revision):
|
||||||
raise ValueError(f"No supported config format found in {model}.")
|
config_format = ConfigFormat.MISTRAL
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
error_message = (
|
||||||
|
"Invalid repository ID or local directory specified:"
|
||||||
|
" '{model}'.\nPlease verify the following requirements:\n"
|
||||||
|
"1. Provide a valid Hugging Face repository ID.\n"
|
||||||
|
"2. Specify a local directory that contains a recognized "
|
||||||
|
"configuration file.\n"
|
||||||
|
" - For Hugging Face models: ensure the presence of a "
|
||||||
|
"'config.json'.\n"
|
||||||
|
" - For Mistral models: ensure the presence of a "
|
||||||
|
"'params.json'.\n")
|
||||||
|
|
||||||
|
raise ValueError(error_message) from e
|
||||||
|
|
||||||
if config_format == ConfigFormat.HF:
|
if config_format == ConfigFormat.HF:
|
||||||
config_dict, _ = PretrainedConfig.get_config_dict(
|
config_dict, _ = PretrainedConfig.get_config_dict(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user