MCPcopy Create free account
hub / github.com/1jehuang/jcode / load

Method load

crates/jcode-base/src/embedding.rs:88–95  ·  view source on GitHub ↗

Load the model from disk (or download if missing)

()

Source from the content-addressed store, hash-verified

86impl Embedder {
87 /// Load the model from disk (or download if missing)
88 pub fn load() -> Result<Self> {
89 let model_dir = models_dir()?;
90 if !backend::is_model_available(&model_dir) {
91 crate::logging::info("Embedding model missing; downloading (one-time setup)...");
92 }
93 let inner = backend::Embedder::load_from_dir(&model_dir)?;
94 Ok(Self { inner })
95 }
96
97 /// Load a model from an explicit directory (must contain `model.onnx` and
98 /// `tokenizer.json`). Used for A/B evaluating alternative embedding models

Callers

nothing calls this directly

Calls 3

models_dirFunction · 0.85
is_model_availableFunction · 0.70
infoFunction · 0.50

Tested by

no test coverage detected