Sentence Similarity
sentence-transformers
PyTorch
TensorFlow
ONNX
Safetensors
OpenVINO
Transformers
English
bert
feature-extraction
text-embeddings-inference
Instructions to use sentence-transformers/multi-qa-MiniLM-L6-cos-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use sentence-transformers/multi-qa-MiniLM-L6-cos-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("sentence-transformers/multi-qa-MiniLM-L6-cos-v1") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use sentence-transformers/multi-qa-MiniLM-L6-cos-v1 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/multi-qa-MiniLM-L6-cos-v1") model = AutoModel.from_pretrained("sentence-transformers/multi-qa-MiniLM-L6-cos-v1") - Inference
- Notebooks
- Google Colab
- Kaggle
Model Card with TensorFlow example
#1
by joaogante - opened
This PRs adds a TensorFlow example that mimics the PT example, that uses the newly added TF weights.
PT example outputs:
0.9156370162963867 Around 9 Million people live in London
0.49475783109664917 London is known for its financial district
TF example outputs:
0.9156371355056763 Around 9 Million people live in London
0.49475765228271484 London is known for its financial district
Thanks for the PR :)
nreimers changed pull request status to merged