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
Can I fine-tuning the model?
Can I add my own dataset to fine-tuning the model? I want to add some data in professional field, maybe it can work better.
Yes, you can. There's some training examples here: https://sbert.net/examples/training/sts/README.html
- Tom Aarsen
Yes, you can. There's some training examples here: https://sbert.net/examples/training/sts/README.html
- Tom Aarsen
Thanks for your reply. :)
I've not experimented with regression, but I think it should be suitable, yes.
For classification, certainly yes. We've developed SetFit for training classification models using Sentence Transformer models. Here's an overview of how & why SetFit works: https://huggingface.co/docs/setfit/conceptual_guides/setfit
- Tom Aarsen
I've not experimented with regression, but I think it should be suitable, yes.
For classification, certainly yes. We've developed SetFit for training classification models using Sentence Transformer models. Here's an overview of how & why SetFit works: https://huggingface.co/docs/setfit/conceptual_guides/setfit
- Tom Aarsen
Thanks.
very helpful.