Sentence Similarity
sentence-transformers
Safetensors
Transformers
English
bert
feature-extraction
text-embeddings-inference
Instructions to use fatymahaly/all-MiniLM-L6-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use fatymahaly/all-MiniLM-L6-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("fatymahaly/all-MiniLM-L6-v2") 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 fatymahaly/all-MiniLM-L6-v2 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("fatymahaly/all-MiniLM-L6-v2") model = AutoModel.from_pretrained("fatymahaly/all-MiniLM-L6-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download modules.json from fatymahaly/all-MiniLM-L6-v2: direct link, hf CLI and curl.
- Browser
- Download file 429 Bytes
-
https://huggingface.co/fatymahaly/all-MiniLM-L6-v2/resolve/main/modules.json
- Command line
-
hf download hf://fatymahaly/all-MiniLM-L6-v2/modules.json
-
curl -L -o modules.json https://huggingface.co/fatymahaly/all-MiniLM-L6-v2/resolve/main/modules.json
429 Bytes
| [ | |
| { | |
| "idx": 0, | |
| "name": "0", | |
| "path": "", | |
| "type": "sentence_transformers.base.modules.transformer.Transformer" | |
| }, | |
| { | |
| "idx": 1, | |
| "name": "1", | |
| "path": "1_Pooling", | |
| "type": "sentence_transformers.sentence_transformer.modules.pooling.Pooling" | |
| }, | |
| { | |
| "idx": 2, | |
| "name": "2", | |
| "path": "2_Normalize", | |
| "type": "sentence_transformers.sentence_transformer.modules.normalize.Normalize" | |
| } | |
| ] |