Skip to content

Commit

Permalink
Add alias for DeepSparseSentenceTransformer
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoin authored Oct 26, 2023
1 parent 1904691 commit 8ef1f86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/deepsparse/sentence_transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
)


from .sentence_transformer import SentenceTransformer
from .sentence_transformer import DeepSparseSentenceTransformer, SentenceTransformer
5 changes: 4 additions & 1 deletion src/deepsparse/sentence_transformers/sentence_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
DEFAULT_MODEL_NAME = "zeroshot/bge-small-en-v1.5-quant"


class SentenceTransformer:
class DeepSparseSentenceTransformer:
"""
Loads or creates a SentenceTransformer-compatible model that can be used to map
text to embeddings.
Expand Down Expand Up @@ -289,3 +289,6 @@ def mean_pooling(
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(
input_mask_expanded.sum(1), min=1e-9
)

# for backwards compatibility
SentenceTransformer = DeepSparseSentenceTransformer

0 comments on commit 8ef1f86

Please sign in to comment.