Skip to content

Commit e7eeb54

Browse files
authored
[BugFix]Fix text_to_image bagel command error (#644)
Signed-off-by: princepride <[email protected]>
1 parent 52afcb6 commit e7eeb54

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

vllm_omni/entrypoints/utils.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ def resolve_model_config_path(model: str) -> str:
113113
f"Could not determine model_type for diffusers model: {model}. "
114114
f"Please ensure the model has 'model_type' in transformer/config.json or model_index.json"
115115
)
116+
elif file_or_path_exists(model, "config.json", revision=None):
117+
# Try to read config.json manually for custom models like Bagel that fail get_config
118+
# but have a valid config.json with model_type
119+
try:
120+
config_dict = get_hf_file_to_dict("config.json", model, revision=None)
121+
if config_dict and "model_type" in config_dict:
122+
model_type = config_dict["model_type"]
123+
else:
124+
raise ValueError(f"config.json found but missing 'model_type' for model: {model}")
125+
except Exception as e:
126+
raise ValueError(f"Failed to read config.json for model: {model}. Error: {e}") from e
116127
else:
117128
raise ValueError(
118129
f"Could not determine model_type for model: {model}. "

0 commit comments

Comments
 (0)