Using AutoModel.from_pretrained() In Transformers To Load Customized Model Architecture
To this day, many AI applications and open-source projects are developed based on the HuggingFace transformers package. A large number of models and packages are written to be compatible with the transformers format, and even share the same functions and methods, which makes them more widely accepted.
Under this premise, I came across an open-source training framework that conveniently wraps the automatic reading of Transformer architectures. However, one unavoidable problem is I want to use my custom model for experiments. I tried several solutions, hoping that when using AutoModel.from_pretrained()
, by simply providing the local path to my model, I could successfully use my custom model architecture. This article records the method that worked.