Block until the model is installed; re-raise the load error if it failed.
(self)
| 174 | self._revalidate_after: dict[str, float] = {} # cache_key -> monotonic time, staleness check is gated until |
| 175 | |
| 176 | async def _await_model(self) -> str: |
| 177 | """Block until the model is installed; re-raise the load error if it failed.""" |
| 178 | await self._model_ready.wait() |
| 179 | if self._model_error is not None: |
| 180 | raise self._model_error |
| 181 | assert self._model_path is not 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.""" |