mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-10 05:20:39 +00:00
31 lines
896 B
Python
31 lines
896 B
Python
"""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"}
|