Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #86.
When a saved index with raw vectors is replaced by an index created with
store_vectors=False,load()currently reattaches the previous snapshot'sstore/vectors.npyto the new items. A vector lookup can therefore return the old document's embedding even though nearest-neighbor queries use the new index.This removes the obsolete library-owned raw-vector file during overwrite, removes its directory only when empty, and checks for the actual vector file when loading. Unrelated files in the snapshot and
store/directory are preserved. Existing snapshots containing raw vectors retain the same format and load behavior. Astore/directory withoutvectors.npynow loads without optional raw-vector access, so unrelated sidecar files can remain.Validation on Python 3.11.13 / NumPy 2.0.2:
git diff --checkand the repository-pinned Ruff 0.4.10 lint/format checks pass.tests/test_vicinity.pysuite could not be collected in this minimal environment because it imports the optionalfaissdependency at module level. The full multi-backend suite and upstream CI were not run locally.The public-API reproduction uses synthetic NumPy arrays only; no model or embedding services were called. Prepared with Codex assistance.