[Docs] optimize and supplement docs system (#86)

Signed-off-by: Gaohan123 <gaohan19@huawei.com>
This commit is contained in:
Gao Han authored and GitHub committed 2025-11-28 11:03:52 +08:00
1 parent 38f58064eb
commit db81ee9f69
75 files changed
+2452 -512

No files matched your search

+25 -4
View File
@@ -13,8 +13,22 @@ logger = logging.getLogger(__name__)
PROJECT_ROOT = Path(__file__).parent.parent.parent
def load_stage_configs_from_model(model: str):
"""Load stage configs from model."""
def load_stage_configs_from_model(model: str) -> list:
"""Load stage configurations from model's default config file.
Loads stage configurations based on the model type. Looks for a
YAML configuration file in the stage_configs directory matching
the model's model_type.
Args:
model: Model name or path (used to determine model_type)
Returns:
List of stage configuration dictionaries
Raises:
FileNotFoundError: If no stage config file exists for the model type
"""
hf_config = get_config(model, trust_remote_code=True)
model_type = hf_config.model_type
stage_config_file = f"vllm_omni/model_executor/stage_configs/{model_type}.yaml"
@@ -25,7 +39,14 @@ def load_stage_configs_from_model(model: str):
return stage_configs
def load_stage_configs_from_yaml(config_path: str):
"""Load stage configs from yaml file."""
def load_stage_configs_from_yaml(config_path: str) -> list:
"""Load stage configurations from a YAML file.
Args:
config_path: Path to the YAML configuration file
Returns:
List of stage configuration dictionaries from the file's stage_args
"""
config_data = OmegaConf.load(config_path)
return config_data.stage_args