Skip to content

Commit

Permalink
make cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
Samoed committed Jan 10, 2025
1 parent d50fd88 commit 7d1e949
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions mteb/models/sentence_transformer_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def __init__(
model: str | SentenceTransformer | CrossEncoder,
revision: str | None = None,
model_prompts: dict[str, str] | None = None,
use_model_similarity: bool = True,
**kwargs,
) -> None:
"""Wrapper for SentenceTransformer models.
Expand All @@ -34,7 +33,6 @@ def __init__(
First priority is given to the composed prompt of task name + prompt type (query or passage), then to the specific task prompt,
then to the composed prompt of task type + prompt type, then to the specific task type prompt,
and finally to the specific prompt type.
use_model_similarity: Whether to use the model's similarity method.
**kwargs: Additional arguments to pass to the SentenceTransformer model.
"""
if isinstance(model, str):
Expand Down Expand Up @@ -62,7 +60,7 @@ def __init__(
if isinstance(self.model, CrossEncoder):
self.predict = self._predict

if hasattr(self.model, "similarity") and use_model_similarity:
if hasattr(self.model, "similarity") and not hasattr(self, "similarity"):
self.similarity = self.model.similarity

def encode(
Expand Down
1 change: 0 additions & 1 deletion mteb/models/sentence_transformers_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@
SentenceTransformerWrapperDotSimilarity,
model="facebook/contriever-msmarco",
revision="abe8c1493371369031bcb1e02acb754cf4e162fa",
use_model_similarity=False,
),
name="facebook/contriever-msmarco",
languages=["eng-Latn"],
Expand Down

0 comments on commit 7d1e949

Please sign in to comment.