What do you guys think about having this in a method called set model?
espoirMur opened this issue · 2 comments
espoirMur commented
if load_weights:
self.model = downstream_model_type.from_pretrained(pretrained_model_name_or_path, **model_data_kwargs)
else:
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **model_data_kwargs)
self.model = downstream_model_type.from_config(config)
First of all thanks you for putting this module in place, I wish I knew it a bit earlier.
Just a suggestion, what you guys think about wrapping the above code in a method call set_model
This can help in case , where the model was not directly from hugging face. For example, I am playing with a model that was customized and has a custom initialization method. In those cases, it can be useful to override the set_model
and keep using the code.
If you guys are okay with this approach I can make a pull request on the weekend to suggest the change.
Regarrds.
SeanNaren commented
Sounds great! Thanks for making this issue, would appreciate a PR ❤️
espoirMur commented
Okay, I will hack on it on Sunday..