Skip to content

Commit

Permalink
add tests for embeddings
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Sep 10, 2024
1 parent 5ad4ebe commit a01ff11
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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"}

0 comments on commit a01ff11

Please sign in to comment.