huggingface[patch]: add integration tests for embeddings (#26272)

This commit is contained in:
ccurme 2024-09-10 14:57:16 -04:00 committed by GitHub
parent 4ffd27c4d0
commit 979232257b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,30 @@
"""Test HuggingFace embeddings."""
from typing import Type
from langchain_standard_tests.integration_tests import EmbeddingsIntegrationTests
from langchain_huggingface.embeddings import (
HuggingFaceEmbeddings,
HuggingFaceEndpointEmbeddings,
)
class TestHuggingFaceEmbeddings(EmbeddingsIntegrationTests):
@property
def embeddings_class(self) -> Type[HuggingFaceEmbeddings]:
return HuggingFaceEmbeddings
@property
def embedding_model_params(self) -> dict:
return {"model_name": "sentence-transformers/all-mpnet-base-v2"}
class TestHuggingFaceEndpointEmbeddings(EmbeddingsIntegrationTests):
@property
def embeddings_class(self) -> Type[HuggingFaceEndpointEmbeddings]:
return HuggingFaceEndpointEmbeddings
@property
def embedding_model_params(self) -> dict:
return {"model": "sentence-transformers/all-mpnet-base-v2"}