Skip to content

Commit

Permalink
Update integrations/fastembed/src/haystack_integrations/components/em…
Browse files Browse the repository at this point in the history
…bedders/fastembed/fastembed_sparse_document_embedder.py

Co-authored-by: Stefano Fiorucci <[email protected]>
  • Loading branch information
Corentin and anakin87 authored Mar 21, 2024
1 parent 0050a6b commit 5ea12b5
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,9 @@ def _prepare_texts_to_embed(self, documents: List[Document]) -> List[str]:
meta_values_to_embed = [
str(doc.meta[key]) for key in self.meta_fields_to_embed if key in doc.meta and doc.meta[key] is not None
]
text_to_embed = [
self.prefix + self.embedding_separator.join([*meta_values_to_embed, doc.content or ""]) + self.suffix,
]
text_to_embed = self.embedding_separator.join([*meta_values_to_embed, doc.content or ""]

texts_to_embed.append(text_to_embed[0])
texts_to_embed.append(text_to_embed)
return texts_to_embed

@component.output_types(documents=List[Document])
Expand Down

0 comments on commit 5ea12b5

Please sign in to comment.