@@ -95,7 +95,8 @@ def __get_pydantic_core_schema__(
9595 Define how Pydantic generates a schema for BaseRagasEmbeddings.
9696 """
9797 return core_schema .no_info_after_validator_function (
98- cls , core_schema .is_instance_schema (cls ) # The validator function
98+ cls ,
99+ core_schema .is_instance_schema (cls ), # The validator function
99100 )
100101
101102
@@ -267,9 +268,9 @@ def embed_documents(self, texts: t.List[str]) -> t.List[t.List[float]]:
267268 from sentence_transformers .SentenceTransformer import SentenceTransformer
268269 from torch import Tensor
269270
270- assert isinstance (
271- self . model , SentenceTransformer
272- ), "Model is not of the type Bi-encoder"
271+ assert isinstance (self . model , SentenceTransformer ), (
272+ "Model is not of the type Bi-encoder"
273+ )
273274 embeddings = self .model .encode (
274275 texts , normalize_embeddings = True , ** self .encode_kwargs
275276 )
@@ -284,9 +285,9 @@ def predict(self, texts: t.List[t.List[str]]) -> t.List[t.List[float]]:
284285 from sentence_transformers .cross_encoder import CrossEncoder
285286 from torch import Tensor
286287
287- assert isinstance (
288- self . model , CrossEncoder
289- ), "Model is not of the type CrossEncoder"
288+ assert isinstance (self . model , CrossEncoder ), (
289+ "Model is not of the type CrossEncoder"
290+ )
290291
291292 predictions = self .model .predict (texts , ** self .encode_kwargs )
292293
0 commit comments