[Future] Enable Users to Use Models Off-the-shelf
Often, users don't want to train the model; they just want to load the pretrained weights (which we can provide - we can perhaps upload them on Google Drive) and use the model for inference. So, we need to write a generic .from_pretrained() function. The usage of this can be something like this:
from src.models.caml import CAML
trained_model = CAML.from_pretrained("<weight-file-path>.pt")
I saw this in Transformer, and I think this is a really cool feature if we have it in the framework. To implement it, we need this from_pretrained() needs model information (like the config we used to initialize the model) in addition to the weights. We can have that information in the weight file, or as a separate input argument of the method.
Exactly! :)