mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 22:42:05 +00:00
community[minor]: DeepInfra support for chat models (#16380)
Add deepinfra chat models support. This is https://github.com/langchain-ai/langchain/pull/14234 re-opened from my branch (so maintainers can edit).
This commit is contained in:
committed by
GitHub
parent
eac91b60c9
commit
fc196cab12
@@ -5,7 +5,7 @@ from langchain_community.embeddings import DeepInfraEmbeddings
|
||||
|
||||
def test_deepinfra_call() -> None:
|
||||
"""Test valid call to DeepInfra."""
|
||||
deepinfra_emb = DeepInfraEmbeddings(model_id="sentence-transformers/clip-ViT-B-32")
|
||||
deepinfra_emb = DeepInfraEmbeddings(model_id="BAAI/bge-base-en-v1.5")
|
||||
r1 = deepinfra_emb.embed_documents(
|
||||
[
|
||||
"Alpha is the first letter of Greek alphabet",
|
||||
@@ -13,7 +13,7 @@ def test_deepinfra_call() -> None:
|
||||
]
|
||||
)
|
||||
assert len(r1) == 2
|
||||
assert len(r1[0]) == 512
|
||||
assert len(r1[1]) == 512
|
||||
assert len(r1[0]) == 768
|
||||
assert len(r1[1]) == 768
|
||||
r2 = deepinfra_emb.embed_query("What is the third letter of Greek alphabet")
|
||||
assert len(r2) == 512
|
||||
assert len(r2) == 768
|
||||
|
Reference in New Issue
Block a user