Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

sentence-transformers
/
all-MiniLM-L6-v2

Sentence Similarity
sentence-transformers
PyTorch
google-tensorflow TensorFlow
Rust
ONNX
Safetensors
OpenVINO
Transformers
English
bert
feature-extraction
Eval Results
text-embeddings-inference
Model card Files Files and versions
xet
Community
162

Instructions to use sentence-transformers/all-MiniLM-L6-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use sentence-transformers/all-MiniLM-L6-v2 with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("sentence-transformers/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 sentence-transformers/all-MiniLM-L6-v2 with Transformers:

    # Load model directly
    from transformers import AutoTokenizer, AutoModel
    
    tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
    model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
  • Inference
  • Notebooks
  • Google Colab
  • Kaggle
New discussion
Resources
  • PR & discussions documentation
  • Code of Conduct
  • Hub documentation

The model's performance

1
#25 opened almost 3 years ago by
drmeir

Hardware requirements for using sentence-transformers/all-MiniLM-L6-v2

πŸ‘ 1
1
#22 opened about 3 years ago by
Nsb39

Adding `safetensors` variant of this model

πŸ‘ 2
#21 opened about 3 years ago by
NarayanB

Upload model.onnx

πŸ‘ 2
1
#19 opened about 3 years ago by
tkelmATlegends

Using embeddings to do sentence similarity

2
#16 opened about 3 years ago by
bilalmalik4321

Where to download training data from?

1
#15 opened about 3 years ago by
fralik

How to input more text? By default, input text longer than 256 word pieces is truncated.

1
#14 opened about 3 years ago by
malelve

Adding new or updating existing vocabulary for enhancing semantic search

πŸ‘ 1
#12 opened over 3 years ago by
ankita3

Moderation with Semantic Pairs of Words

#8 opened over 3 years ago by
woisme

Possible to use it to embbed other languages than english ?

3
#7 opened over 3 years ago by
MaximeTut

Request: DOI

πŸ‘ 9
2
#3 opened almost 4 years ago by
abdusah

Add MTEB metadata

#2 opened almost 4 years ago by
Muennighoff

Max Length

βž• 15
6
#1 opened almost 4 years ago by
dadlifejason
  • Previous
  • 1
  • 2
  • 3
  • Next
Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs