Skip to content

The agent engineering platform.

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

Prakhar Agarwal53b14de63608
diff --git a/langchain/embeddings/tensorflow_hub.py b/langchain/embeddings/tensorflow_hub.py
index 25e63949c4..0dc439233a 100644
--- a/langchain/embeddings/tensorflow_hub.py
+++ b/langchain/embeddings/tensorflow_hub.py
@@ -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()