From e7eeb54e08558ee89a2e53c4f6f5380769c09bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=97=E9=B9=8F?= Date: Mon, 5 Jan 2026 18:22:15 +0800 Subject: [PATCH] [BugFix]Fix text_to_image bagel command error (#644) Signed-off-by: princepride --- vllm_omni/entrypoints/utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vllm_omni/entrypoints/utils.py b/vllm_omni/entrypoints/utils.py index 770f695c6..135b0e89f 100644 --- a/vllm_omni/entrypoints/utils.py +++ b/vllm_omni/entrypoints/utils.py @@ -113,6 +113,17 @@ def resolve_model_config_path(model: str) -> str: f"Could not determine model_type for diffusers model: {model}. " f"Please ensure the model has 'model_type' in transformer/config.json or model_index.json" ) + elif file_or_path_exists(model, "config.json", revision=None): + # Try to read config.json manually for custom models like Bagel that fail get_config + # but have a valid config.json with model_type + try: + config_dict = get_hf_file_to_dict("config.json", model, revision=None) + if config_dict and "model_type" in config_dict: + model_type = config_dict["model_type"] + else: + raise ValueError(f"config.json found but missing 'model_type' for model: {model}") + except Exception as e: + raise ValueError(f"Failed to read config.json for model: {model}. Error: {e}") from e else: raise ValueError( f"Could not determine model_type for model: {model}. "