mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
2cf1e73d12
Description: Volcano Ark is an enterprise-grade large-model service platform for developers, providing a full range of functions and services such as model training, inference, evaluation, fine-tuning. You can visit its homepage at https://www.volcengine.com/docs/82379/1099455 for details. This change could help developers use the platform for embedding. Issue: None Dependencies: volcengine Tag maintainer: @baskaryan Twitter handle: @hinnnnnnnnnnnns --------- Co-authored-by: lujingxuansc <lujingxuansc@bytedance.com>
20 lines
575 B
Python
20 lines
575 B
Python
"""Test Bytedance Volcano Embedding."""
|
|
from langchain_community.embeddings import VolcanoEmbeddings
|
|
|
|
|
|
def test_embedding_documents() -> None:
|
|
"""Test embeddings for documents."""
|
|
documents = ["foo", "bar"]
|
|
embedding = VolcanoEmbeddings()
|
|
output = embedding.embed_documents(documents)
|
|
assert len(output) == 2
|
|
assert len(output[0]) == 1024
|
|
|
|
|
|
def test_embedding_query() -> None:
|
|
"""Test embeddings for query."""
|
|
document = "foo bar"
|
|
embedding = VolcanoEmbeddings()
|
|
output = embedding.embed_query(document)
|
|
assert len(output) == 1024
|