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
version for requirements
#24
by acortis - opened
Hi,
What would be the best way of downloading and using a specific version of this library into a requirements.txt file for pip (or even better for pipenv), as opposed to downloading the latest version with a pipeline from code?
Hey @acortis , to specify a specific version of any model, you can specify the revision kwarg to any loading method (from_pretrained, pipeline, ...).
In this situation, the latest revision would be 9fc9c4e1808b5613968646fa771fc43fb03995f2, so you can specify this as a revision and be ensured that what you download will always be the current version.
Hope that helps!