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

Function _ensure_model_loaded

uncommon_route/router/classifier.py:53–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52
53def _ensure_model_loaded() -> None:
54 global _model, _model_load_attempted
55 if _model_load_attempted:
56 return
57 _model_load_attempted = True
58 online = _get_online_model_path()
59 default = Path(__file__).parent / "model.json"
60 if online.exists():
61 _model = ScriptAgnosticClassifier()
62 _model.load(online)
63 elif default.exists():
64 _model = ScriptAgnosticClassifier()
65 _model.load(default)
66
67
68def load_learned_model(path: str | None = None) -> None:

Callers 6

extract_featuresFunction · 0.85
update_modelFunction · 0.85
rollback_online_modelFunction · 0.85
classifyFunction · 0.85

Calls 3

loadMethod · 0.95
_get_online_model_pathFunction · 0.85