Skip to content

Commit

Permalink
Inverted Index Phase 9.
Browse files Browse the repository at this point in the history
  • Loading branch information
sounakr committed Aug 24, 2024
1 parent 0093eed commit 964d8de
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions deeplake/core/index_maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ class INDEX_OP_TYPE(Enum):

def validate_embedding_tensor(tensor):
"""Check if a tensor is an embedding tensor."""
return tensor.htype == "embedding"

valid_names = ["embedding"]

return (
tensor.htype == "embedding"
or tensor.meta.name in valid_names
or tensor.key in valid_names
)


def validate_text_tensor(tensor):
Expand Down Expand Up @@ -254,7 +261,7 @@ def index_operation_vectorstore(self):

emb_tensor = fetch_embedding_tensor(self.dataset)

if index_exists_emb(self) and check_index_params(self):
if index_exists_emb(emb_tensor) and check_index_params(self):
return emb_tensor.get_vdb_indexes()[0]["distance"]

threshold = self.index_params.get("threshold", -1)
Expand Down

0 comments on commit 964d8de

Please sign in to comment.