pass list of strings to embed method in tf_hub (#3284)

This fixes the below mentioned issue. Instead of simply passing the text
to `tensorflow_hub`, we convert it to a list and then pass it.
https://github.com/hwchase17/langchain/issues/3282

Co-authored-by: Prakhar Agarwal <i.prakhar-agarwal@devrev.ai>
pull/3488/head
Prakhar Agarwal 1 year ago committed by GitHub
parent 2b9f1cea4e
commit 53b14de636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -66,5 +66,5 @@ class TensorflowHubEmbeddings(BaseModel, Embeddings):
Embeddings for the text.
"""
text = text.replace("\n", " ")
embedding = self.embed(text).numpy()[0]
embedding = self.embed([text]).numpy()[0]
return embedding.tolist()

Loading…
Cancel
Save