Read the engine config file and create a ModelConfig instance, return the ModelConfig instance and other config fields in a dict. Args: config_path (Path): The path of engine config file. Returns: Tuple[ModelConfig, dict]: A ModelConfig instance and oth
(config_path: Path)
| 65 | |
| 66 | |
| 67 | def read_config(config_path: Path) -> Tuple[ModelConfig, dict]: |
| 68 | """ |
| 69 | Read the engine config file and create a ModelConfig instance, return the ModelConfig instance |
| 70 | and other config fields in a dict. |
| 71 | |
| 72 | Args: |
| 73 | config_path (Path): |
| 74 | The path of engine config file. |
| 75 | |
| 76 | Returns: |
| 77 | Tuple[ModelConfig, dict]: A ModelConfig instance and other config fields. |
| 78 | """ |
| 79 | with open(config_path, 'r') as f: |
| 80 | config = json.load(f) |
| 81 | return _builder_to_model_config(config) |
| 82 | |
| 83 | |
| 84 | def _builder_to_model_config(config: dict) -> Tuple[ModelConfig, dict]: |
no test coverage detected