chore: improve position map conversion and tolerate empty position yaml file (#6541)

This commit is contained in:
Bowen Liang
2024-07-29 10:32:11 +08:00
committed by GitHub
parent c8da4a1b7e
commit 20268708cc
7 changed files with 44 additions and 32 deletions

View File

@@ -162,7 +162,7 @@ class AIModel(ABC):
# traverse all model_schema_yaml_paths
for model_schema_yaml_path in model_schema_yaml_paths:
# read yaml data from yaml file
yaml_data = load_yaml_file(model_schema_yaml_path, ignore_error=True)
yaml_data = load_yaml_file(model_schema_yaml_path)
new_parameter_rules = []
for parameter_rule in yaml_data.get('parameter_rules', []):

View File

@@ -44,7 +44,7 @@ class ModelProvider(ABC):
# read provider schema from yaml file
yaml_path = os.path.join(current_path, f'{provider_name}.yaml')
yaml_data = load_yaml_file(yaml_path, ignore_error=True)
yaml_data = load_yaml_file(yaml_path)
try:
# yaml_data to entity