Zero-Shot Classification
sentence-transformers
PyTorch
ONNX
Safetensors
OpenVINO
Transformers
English
roberta
text-classification
Instructions to use cross-encoder/nli-MiniLM2-L6-H768 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cross-encoder/nli-MiniLM2-L6-H768 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("cross-encoder/nli-MiniLM2-L6-H768") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Transformers
How to use cross-encoder/nli-MiniLM2-L6-H768 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="cross-encoder/nli-MiniLM2-L6-H768")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("cross-encoder/nli-MiniLM2-L6-H768") model = AutoModelForSequenceClassification.from_pretrained("cross-encoder/nli-MiniLM2-L6-H768", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download onnx/model_O2.onnx from cross-encoder/nli-MiniLM2-L6-H768: direct link, hf CLI and curl.
- Browser
- Download file 329 MB
-
https://huggingface.co/cross-encoder/nli-MiniLM2-L6-H768/resolve/main/onnx/model_O2.onnx
- Command line
-
hf download hf://cross-encoder/nli-MiniLM2-L6-H768/onnx/model_O2.onnx
-
curl -L -o model_O2.onnx https://huggingface.co/cross-encoder/nli-MiniLM2-L6-H768/resolve/main/onnx/model_O2.onnx
329 MB
- Xet hash:
- 892e17cac2f06f6aa4c663222ceb086a9b343646672bf66f58b18535db51303f
- Size of remote file:
- 329 MB
- SHA256:
- 1e320643f4e1dec3a1d2d2566b3b1e61b13427b106281442ccf862a39efae820
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.