Skip to content

Commit

Permalink
check if model attr of model exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Samoed committed Nov 26, 2024
1 parent 3ff38ec commit b3304a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mteb/evaluation/evaluators/RetrievalEvaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def search_cross_encoder(
len(queries_in_pair) == len(corpus_in_pair) == len(instructions_in_pair)
)

if isinstance(self.model.model, CrossEncoder):
if hasattr(self.model, "model") and isinstance(self.model.model, CrossEncoder):
# can't take instructions, so add them here
queries_in_pair = [
f"{q} {i}".strip()
Expand Down Expand Up @@ -428,7 +428,7 @@ def encode(


def is_cross_encoder_compatible(model) -> bool:
op = getattr(model.model, "predict", None)
op = getattr(model, "predict", None)
return callable(op)


Expand Down

0 comments on commit b3304a3

Please sign in to comment.