File size: 607 Bytes
cfd3735
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""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