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
Potential Inconsistencies Model and Datasets License
Hi, while reviewing the licenses for this model and datasets it depends on, I noticed a potential inconsistency that could cause confusion or legal risks in some situations.
Your model utilizes the dataset stanfordnlp/snli is licensed under the cc-by-sa-4.0. However, the license of your model is apache-2.0, i.e., less strict than cc-by-sa-4.0 on license terms, which may impact the whole license compatibility in your repository, thus confusing subsequent users and bringing possible legal and financial risks.
If possible, you can fix them in one of the following ways:
1.It could be helpful to select another proper license for your repository.
2.You may want to gently remind users that, in some cases, they should check both the model license and the base model license, especially when redistributing or modifying the model.