fix: validate embedding model dimensions - #19
Conversation
|
Welcome, @medlouaynjima, and thanks for your first pull request to VaultRAG. A quick look at CONTRIBUTING.md covers how things are set up and run here. I'll review this shortly. Ask anything in the thread if something is unclear. |
royalpinto007
left a comment
There was a problem hiding this comment.
The dimension check only fails once because the invalid model and dimension are cached before validation. After the first ValueError, a second dims access returns 768 and embed() can reuse the incompatible model. Please validate before caching, or persist the failure, and add a regression test for repeated access. Everything else looks good.
royalpinto007
left a comment
There was a problem hiding this comment.
The repeated dimension validation issue is fixed, but LocalEmbedder._load() no longer returns the validated model, so embed() fails with AttributeError even for a valid 384-dimensional model. Please restore the return value and add a regression test that calls embed().
Fixes #9
What changed
LocalEmbedderloads a model.LocalEmbedder.dims.vector(384)schema.EMBED_MODEL.Validation
pytest -q tests/test_embeddings.pygit diff --check