Skip to content

Commit ec8c37e

Browse files
committed
fix(ci): mypy fixes — annotate warnings, remove duplicate benchmarker.compare_models, avoid type-conflict in edgeflowc
1 parent 4b78717 commit ec8c37e

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

benchmarker.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,6 @@ def benchmark_model(model_path: str, config: Dict[str, Any]) -> Dict[str, Any]:
410410
return benchmarker.benchmark_model(model_path)
411411

412412

413-
def compare_models(
414-
original_path: str, optimized_path: str, config: Dict[str, Any]
415-
) -> Dict[str, Any]:
416-
"""Compare two models (original vs optimized)."""
417-
418-
419413
def compare_models(
420414
original_path: str, optimized_path: str, config: Dict[str, Any]
421415
) -> Dict[str, Any]:

edgeflowc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,20 +421,20 @@ def main() -> int:
421421
"No model_path/model specified in config; skipping check"
422422
)
423423
else:
424-
should_optimize, report = perform_initial_check(
424+
should_optimize, compat_report = perform_initial_check(
425425
model_path, cfg, getattr(args, "device_spec_file", None)
426426
)
427427
print(f" Device: {cfg.get('target_device', 'generic')}")
428-
print(f" Fit Score: {report.estimated_fit_score:.1f}/100")
428+
print(f" Fit Score: {compat_report.estimated_fit_score:.1f}/100")
429429

430430
if getattr(args, "check_only", False):
431-
if report.issues:
431+
if compat_report.issues:
432432
print("\n\N{WARNING SIGN} Issues found:")
433-
for issue in report.issues:
433+
for issue in compat_report.issues:
434434
print(f" - {issue}")
435-
if report.recommendations:
435+
if compat_report.recommendations:
436436
print("\n\N{ELECTRIC LIGHT BULB} Recommendations:")
437-
for rec in report.recommendations:
437+
for rec in compat_report.recommendations:
438438
print(f" - {rec}")
439439
return 0
440440

fast_compile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def fast_compile(self, config: Dict[str, Any]) -> FastCompileResult:
107107

108108
# Step 1: Fast validation (no model loading)
109109
is_valid, errors = self.validator.early_validation(config)
110-
warnings = []
110+
warnings: List[str] = []
111111

112112
if not is_valid:
113113
compile_time = (time.time() - start_time) * 1000
@@ -228,7 +228,7 @@ def _generate_warnings(
228228
self, config: Dict[str, Any], estimated_impact: Dict[str, Any]
229229
) -> List[str]:
230230
"""Generate warnings based on configuration and estimated impact."""
231-
warnings = []
231+
warnings: List[str] = []
232232

233233
device = config.get("target_device", "cpu")
234234
quantize = config.get("quantize", "none")

0 commit comments

Comments
 (0)