mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
huggingface[patch]: add integration tests for embeddings (#26272)
This commit is contained in:
parent
4ffd27c4d0
commit
979232257b
@ -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"}
|
Loading…
Reference in New Issue
Block a user