Auto Classes
Last updated
Last updated
In many cases, the architecture you want to use can be guessed from the name or the path of the pretrained model you are supplying to the from_pretrained()
method. AutoClasses are here to do this job for you so that you automatically retrieve the relevant model given the name/path to the pretrained weights/config/vocabulary.
Instantiating one of , , and will directly create a class of the relevant architecture. For instance
Copied
will create a model that is an instance of .
There is one class of AutoModel
for each task, and for each backend (PyTorch, TensorFlow, or Flax).