(engine_dir: str)
| 746 | |
| 747 | |
| 748 | def get_engine_version(engine_dir: str) -> Union[None, str]: |
| 749 | engine_dir = Path(engine_dir) |
| 750 | config_path = engine_dir / "config.json" |
| 751 | with open(config_path, 'r') as f: |
| 752 | config = json.load(f) |
| 753 | |
| 754 | if 'version' not in config: |
| 755 | return None |
| 756 | |
| 757 | return config['version'] |
| 758 | |
| 759 | |
| 760 | def optimize_model_with_config(model: PretrainedModel, |
no test coverage detected