(details: dict[str, Any], source_path: Path)
| 340 | |
| 341 | |
| 342 | def _infer_arch(details: dict[str, Any], source_path: Path) -> str: |
| 343 | arch = str( |
| 344 | details.get("architecture") |
| 345 | or _as_dict(details.get("extras")).get("architecture") |
| 346 | or _as_dict(details.get("extras")).get("arch") |
| 347 | or "" |
| 348 | ) |
| 349 | if arch: |
| 350 | return arch |
| 351 | |
| 352 | stem_parts = source_path.stem.split("_") |
| 353 | if len(stem_parts) >= 3: |
| 354 | return stem_parts[-1] |
| 355 | return "" |
| 356 | |
| 357 | |
| 358 | def _canonicalize_model_alias(value: Any) -> str: |
no test coverage detected