mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-04 04:07:54 +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.
|
||||
"""
|
||||
text = text.replace("\n", " ")
|
||||
embedding = self.embed(text).numpy()[0]
|
||||
embedding = self.embed([text]).numpy()[0]
|
||||
return embedding.tolist()
|
||||
|
Loading…
Reference in New Issue
Block a user