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
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

mlx-community
/
all-MiniLM-L6-v2-4bit

Sentence Similarity
sentence-transformers
Safetensors
Transformers
MLX
English
bert
feature-extraction
text-embeddings-inference
Model card Files Files and versions
xet
Community

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

  • Libraries
  • sentence-transformers

    How to use mlx-community/all-MiniLM-L6-v2-4bit with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("mlx-community/all-MiniLM-L6-v2-4bit")
    
    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 mlx-community/all-MiniLM-L6-v2-4bit with Transformers:

    # Load model directly
    from transformers import AutoTokenizer, AutoModel
    
    tokenizer = AutoTokenizer.from_pretrained("mlx-community/all-MiniLM-L6-v2-4bit")
    model = AutoModel.from_pretrained("mlx-community/all-MiniLM-L6-v2-4bit")
  • MLX

    How to use mlx-community/all-MiniLM-L6-v2-4bit with MLX:

    # Download the model from the Hub
    pip install huggingface_hub[hf_xet]
    
    huggingface-cli download --local-dir all-MiniLM-L6-v2-4bit mlx-community/all-MiniLM-L6-v2-4bit
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • LM Studio
all-MiniLM-L6-v2-4bit
Ctrl+K
Ctrl+K
  • 1 contributor
History: 2 commits
prince-canuma's picture
prince-canuma
Upload folder using huggingface_hub
128ca2d verified about 1 year ago
  • .gitattributes
    1.52 kB
    initial commit about 1 year ago
  • README.md
    1.49 kB
    Upload folder using huggingface_hub about 1 year ago
  • config.json
    674 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • config_sentence_transformers.json
    116 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • data_config.json
    39.3 kB
    Upload folder using huggingface_hub about 1 year ago
  • model.safetensors
    12.8 MB
    xet
    Upload folder using huggingface_hub about 1 year ago
  • model.safetensors.index.json
    13.5 kB
    Upload folder using huggingface_hub about 1 year ago
  • modules.json
    349 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • sentence_bert_config.json
    53 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • special_tokens_map.json
    695 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • tokenizer.json
    712 kB
    Upload folder using huggingface_hub about 1 year ago
  • tokenizer_config.json
    1.46 kB
    Upload folder using huggingface_hub about 1 year ago
  • train_script.py
    13.2 kB
    Upload folder using huggingface_hub about 1 year ago
  • vocab.txt
    232 kB
    Upload folder using huggingface_hub about 1 year ago