mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
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>
This commit is contained in:
parent
2b9f1cea4e
commit
53b14de636
@ -66,5 +66,5 @@ class TensorflowHubEmbeddings(BaseModel, Embeddings):
|
|||||||
Embeddings for the text.
|
Embeddings for the text.
|
||||||
"""
|
"""
|
||||||
text = text.replace("\n", " ")
|
text = text.replace("\n", " ")
|
||||||
embedding = self.embed(text).numpy()[0]
|
embedding = self.embed([text]).numpy()[0]
|
||||||
return embedding.tolist()
|
return embedding.tolist()
|
||||||
|
Loading…
Reference in New Issue
Block a user