Load the model from disk (or download if missing)
()
| 86 | impl 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 |
nothing calls this directly
no test coverage detected