MoritzLaurer/synthetic_zeroshot_mixtral_v0.1
Viewer • Updated • 2.63M • 466 • 9
How to use r-f/ModernBERT-large-zeroshot-v1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("zero-shot-classification", model="r-f/ModernBERT-large-zeroshot-v1") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("r-f/ModernBERT-large-zeroshot-v1")
model = AutoModelForSequenceClassification.from_pretrained("r-f/ModernBERT-large-zeroshot-v1")This model is a fine-tuned ModernBERT-large for Natural Language Inference. It was trained on the MoritzLaurer/synthetic_zeroshot_mixtral_v0.1 and is designed to carry out zero-shot classification.
To be added.
pip install transformers torch datasets
classifier = pipeline("zero-shot-classification", "r-f/ModernBERT-large-zeroshot-v1")
sequence_to_classify = "I want to be an actor."
candidate_labels = ["space", "economy", "entertainment"]
output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
print(output)
>>{'sequence': 'I want to be an actor.', 'labels': ['entertainment', 'space', 'economy'], 'scores': [0.9614731073379517, 0.028852475807070732, 0.009674412198364735]}
This model is licensed under the MIT License. See the LICENSE file for more details.
Base model
answerdotai/ModernBERT-large