Instructions to use facebook/bart-large-mnli with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/bart-large-mnli with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-mnli") model = AutoModelForSequenceClassification.from_pretrained("facebook/bart-large-mnli") - Inference
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -62,8 +62,8 @@ classifier(sequence_to_classify, candidate_labels, multi_class=True)
|
|
| 62 |
```python
|
| 63 |
# pose sequence as a NLI premise and label as a hypothesis
|
| 64 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 65 |
-
nli_model = AutoModelForSequenceClassification.from_pretrained('
|
| 66 |
-
tokenizer = AutoTokenizer.from_pretrained('
|
| 67 |
|
| 68 |
premise = sequence
|
| 69 |
hypothesis = f'This example is {label}.'
|
|
|
|
| 62 |
```python
|
| 63 |
# pose sequence as a NLI premise and label as a hypothesis
|
| 64 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 65 |
+
nli_model = AutoModelForSequenceClassification.from_pretrained('facebook/bart-large-mnli')
|
| 66 |
+
tokenizer = AutoTokenizer.from_pretrained('facebook/bart-large-mnli')
|
| 67 |
|
| 68 |
premise = sequence
|
| 69 |
hypothesis = f'This example is {label}.'
|