Skip to content

Commit

Permalink
feat(FastEmbed): removed old TODO (fixed)
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-science committed Mar 13, 2024
1 parent e1c5602 commit a9b3827
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ def run(self, documents: List[Document]):
msg = "The embedding model has not been loaded. Please call warm_up() before running."
raise RuntimeError(msg)

# TODO: once non textual Documents are properly supported, we should also prepare them for embedding here

texts_to_embed = self._prepare_texts_to_embed(documents=documents)
embeddings = self.embedding_backend.embed(
texts_to_embed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ def run(self, documents: List[Document]):
msg = "The embedding model has not been loaded. Please call warm_up() before running."
raise RuntimeError(msg)

# TODO: once non textual Documents are properly supported, we should also prepare them for embedding here

texts_to_embed = self._prepare_texts_to_embed(documents=documents)
embeddings = self.embedding_backend.embed(
texts_to_embed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ def test_embed(self):
assert len(result["documents"]) == len(documents)
for doc in result["documents"]:
assert isinstance(doc, Document)
# TODO adapt for sparse
assert isinstance(doc.meta["_sparse_vector"], dict)
assert isinstance(doc.meta["_sparse_vector"]["indices"], list)
assert isinstance(doc.meta["_sparse_vector"]["indices"][0], int)
Expand Down Expand Up @@ -292,7 +291,6 @@ def test_run(self):
result = embedder.run(documents=[doc])
# TODO adapt for sparse
embedding = result["documents"][0].embedding
# TODO adapt for sparse
assert isinstance(embedding, list)
assert len(embedding) == 384
assert all(isinstance(emb, float) for emb in embedding)
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ def test_embed(self):

result = embedder.run(text=text)
embedding = result["embedding"]
# TODO adapt to sparse
assert isinstance(embedding, dict)
assert isinstance(embedding["indices"], list)
assert isinstance(embedding["indices"][0], int)
Expand Down

0 comments on commit a9b3827

Please sign in to comment.