icd-coding-benchmark icon indicating copy to clipboard operation
icd-coding-benchmark copied to clipboard

[Future] Enable Users to Use Models Off-the-shelf

Open abheesht17 opened this issue 3 years ago • 2 comments

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")

abheesht17 avatar Mar 18 '22 08:03 abheesht17

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.

dalgu90 avatar Mar 18 '22 17:03 dalgu90

Exactly! :)

abheesht17 avatar Mar 18 '22 19:03 abheesht17