Zero-Shot Classification
sentence-transformers
PyTorch
ONNX
Safetensors
OpenVINO
Transformers
English
roberta
text-classification
Run this model with HF Jobs
Run cross-encoder/nli-MiniLM2-L6-H768 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/cross-encoder/nli-MiniLM2-L6-H768. 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/cross-encoder/nli-MiniLM2-L6-H768 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 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 special_tokens_map.json from cross-encoder/nli-MiniLM2-L6-H768: direct link, hf CLI and curl.
- Browser
- Download file 239 Bytes
-
https://huggingface.co/cross-encoder/nli-MiniLM2-L6-H768/resolve/main/special_tokens_map.json
- Command line
-
hf download hf://cross-encoder/nli-MiniLM2-L6-H768/special_tokens_map.json
-
curl -L -o special_tokens_map.json https://huggingface.co/cross-encoder/nli-MiniLM2-L6-H768/resolve/main/special_tokens_map.json
239 Bytes
| {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}} |