Text Classification
sentence-transformers
Safetensors
English
qwen2
pretrained
text-embeddings-inference
Instructions to use ssmits/Qwen2-7B-Instruct-embed-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ssmits/Qwen2-7B-Instruct-embed-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ssmits/Qwen2-7B-Instruct-embed-base") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -70,7 +70,6 @@ def mean_pooling(model_output, attention_mask):
|
|
| 70 |
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
|
| 71 |
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
|
| 72 |
|
| 73 |
-
|
| 74 |
# Sentences we want sentence embeddings for
|
| 75 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 76 |
|
|
|
|
| 70 |
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
|
| 71 |
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
|
| 72 |
|
|
|
|
| 73 |
# Sentences we want sentence embeddings for
|
| 74 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 75 |
|