mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-29 21:30:18 +00:00
Harrison/tf embeddings (#817)
Co-authored-by: Ryohei Kuroki <10434946+yakigac@users.noreply.github.com>
This commit is contained in:
19
tests/integration_tests/embeddings/test_tensorflow_hub.py
Normal file
19
tests/integration_tests/embeddings/test_tensorflow_hub.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Test TensorflowHub embeddings."""
|
||||
from langchain.embeddings import TensorflowHubEmbeddings
|
||||
|
||||
|
||||
def test_tensorflowhub_embedding_documents() -> None:
|
||||
"""Test tensorflowhub embeddings."""
|
||||
documents = ["foo bar"]
|
||||
embedding = TensorflowHubEmbeddings()
|
||||
output = embedding.embed_documents(documents)
|
||||
assert len(output) == 1
|
||||
assert len(output[0]) == 512
|
||||
|
||||
|
||||
def test_tensorflowhub_embedding_query() -> None:
|
||||
"""Test tensorflowhub embeddings."""
|
||||
document = "foo bar"
|
||||
embedding = TensorflowHubEmbeddings()
|
||||
output = embedding.embed_query(document)
|
||||
assert len(output) == 512
|
||||
Reference in New Issue
Block a user