Compute the canonical cache key for a source.
(self, source: str, ref: str | None = None)
| 182 | return self._model_path |
| 183 | |
| 184 | def _compute_cache_key(self, source: str, ref: str | None = None) -> str: |
| 185 | """Compute the canonical cache key for a source.""" |
| 186 | is_git = is_git_url(source) |
| 187 | return (f"{source}@{ref}" if ref else source) if is_git else str(Path(source).resolve()) |
| 188 | |
| 189 | def _build_and_cache_index(self, source: str, ref: str | None, model_path: str, cache_key: str) -> SembleIndex: |
| 190 | """Build an index for the given source and cache it.""" |