You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I take this example from the OpenAIDocumentEmbedder docstring:
fromhaystackimportDocumentfromhaystack.components.embeddersimportOpenAIDocumentEmbedderdoc=Document(content="I love pizza!")
# doc.embedding is None, as I would expectdocument_embedder=OpenAIDocumentEmbedder()
result=document_embedder.run([doc])
print(result['documents'][0].embedding)
# Surprising to me, doc.embedding now also holds a vector.
^ Is this intended behaviour?
Maybe it could be made more explicit like in pytorch where inplace methods carry a trailing underscore: document_embedder.run_([doc]) OR a copy.deepcopy could be added somewhere?
The text was updated successfully, but these errors were encountered:
Hi,
I take this example from the
OpenAIDocumentEmbedder
docstring:^ Is this intended behaviour?
Maybe it could be made more explicit like in
pytorch
where inplace methods carry a trailing underscore:document_embedder.run_([doc])
OR acopy.deepcopy
could be added somewhere?The text was updated successfully, but these errors were encountered: