Sentence Similarity
ONNX
sentence-transformers
light-embed
bert
feature-extraction
text-embeddings-inference
Run this model with HF Jobs
Run LightEmbed/sbert-all-MiniLM-L6-v2-onnx on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/LightEmbed/sbert-all-MiniLM-L6-v2-onnx. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/LightEmbed/sbert-all-MiniLM-L6-v2-onnx on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use LightEmbed/sbert-all-MiniLM-L6-v2-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use LightEmbed/sbert-all-MiniLM-L6-v2-onnx with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("LightEmbed/sbert-all-MiniLM-L6-v2-onnx") 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] - Notebooks
- Google Colab
- Kaggle
Add new SentenceTransformer model.
Browse filesFiles changed (4)
- README.mdAdded+45
- config.json+1-1
- model_description.jsonAdded+6
- model_descriptions.jsonAdded+6
123456789101112131415161718192021222324252627282930313233343536373839404142434445---library_name: light-embedpipeline_tag: sentence-similaritytags:- sentence-transformers- feature-extraction- sentence-similarity
---
# sbert-all-MiniLM-L6-v2-onnx
This is the ONNX version of the Sentence Transformers model sentence-transformers/all-MiniLM-L6-v2 for sentence embedding, optimized for speed and lightweight performance. By utilizing onnxruntime and tokenizers instead of heavier libraries like sentence-transformers and transformers, this version ensures a smaller library size and faster execution. Below are the details of the model:- Base model: sentence-transformers/all-MiniLM-L6-v2- Embedding dimension: 384- Max sequence length: 256- File size on disk: 0.08 GB
This ONNX model consists all components in the original sentence transformer model:Transformer, Pooling, Normalize
<!--- Describe your model here -->
## Usage (LightEmbed)
Using this model becomes easy when you have [LightEmbed](https://www.light-embed.net) installed:
```pip install -U light-embed```
Then you can use the model like this:
```pythonfrom light_embed import TextEmbeddingsentences = ["This is an example sentence", "Each sentence is converted"]
model = TextEmbedding('sentence-transformers/all-MiniLM-L6-v2')embeddings = model.encode(sentences)print(embeddings)```
## Citing & Authors
Binh Nguyen / binhcode25@gmail.com12345{"_name_or_path": "nreimers/MiniLM-L6-H384-uncased","architectures": ["BertModel"],12345{"_name_or_path": "sentence-transformers/all-MiniLM-L6-v2","architectures": ["BertModel"],
123456{ "base_model": "sentence-transformers/all-MiniLM-L6-v2", "embedding_dim": 384, "max_seq_length": 256, "model_file_size (GB)": 0.08}123456{ "base_model": "sentence-transformers/all-MiniLM-L6-v2", "embedding_dim": 384, "max_seq_length": 256, "model_file_size (GB)": 0.08}README.mdAdded+45
config.json+1-1
model_description.jsonAdded+6
model_descriptions.jsonAdded+6