MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / load

Method load

uncommon_route/router/learned.py:250–262  ·  view source on GitHub ↗
(self, path: Path)

Source from the content-addressed store, hash-verified

248 return collapsed
249
250 def load(self, path: Path) -> None:
251 data = json.loads(path.read_text())
252 avg_weights = self._collapse_loaded_weights(data.get("avg_weights", {}))
253 weights = self._collapse_loaded_weights(data.get("weights", {}))
254 self._avg_weights = {
255 t: defaultdict(float, avg_weights.get(t, {})) for t in self.TIERS
256 }
257 self._weights = {
258 t: defaultdict(float, weights.get(t, {})) for t in self.TIERS
259 }
260 self._update_count = data.get("update_count", 1)
261 self._use_ngrams = data.get("use_ngrams", True)
262 self._trained = True
263
264

Callers 6

_ensure_model_loadedFunction · 0.95
load_learned_modelFunction · 0.95
load_calibratorFunction · 0.45
__init__Method · 0.45
_try_load_scalerMethod · 0.45
__init__Method · 0.45

Calls 2

getMethod · 0.45

Tested by

no test coverage detected