I'm getting started using the transformers library from HuggingFace.co. When I run the below file, it works, but I get an error indicating I'm not following best practices.
from transformers import pipeline
print(pipeline('sentiment-analysis')('I love you'))
When I run that file with python main.py
I get this error:
2.014 No model was supplied, defaulted to distilbert-base-uncased-finetuned-sst-2-english and revision af0f99b (https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english).
2.014 Using a pipeline without specifying a model name and revision in production is not recommended.
But when I google that error message, this question doesn't show up with the best practice for specifying a model and revision. Additionally, assuming it's not too involved, I'd also like to see how the model can be cached, say, when building a Dockerfile in an elegant way. Is there perhaps a way of having models download by stuffing them into the requirements.txt file.