Closed Sukh-P closed 3 months ago
Interesting, do you know wen this PytorchModelHubMixin was removed? and why?
I guess it was removed to make it cleaner? or there was some comptability issue?
@peterdudfield I think the commit with that change was created by yourself https://github.com/openclimatefix/PVNet/pull/238/files so I was hoping you may be able to shed some light on that part 😄
ah, not sure, my mistale for not testing it properly, is it easy to put back in?
Yep it is straight forward, just wanted to check there wasn't a specific reason we wanted to remove it since as I mentioned I think we could implement something ourself to avoid using it
Describe the bug
Currently when trying to save a model to HF with the code in the main branch one would encounter this error:
I believe this happens now since in this commit the
PyTorchModelHubMixin
class was removed, it turns out that we were using the _save_pretrained method from it in our base model save_pretrained methodSo I think there are two ways this could be fixed:
PyTorchModelHubMixin
and inheriting from itPyTorchModelHubMixin
is unnecessary overhead just for that one method (I am assumed it isn't used elswhere) we could implement our own '_save_pretrained' method to save model weights locally, wouldn't be too hard I think since the method HF uses looks quite straightforward, I tried just a torch.save() replacement but that seems to not quite work but hopefully not too much more complicated than something like that, @peterdudfield would be good to get your opinion as you probably have most context for the pros/cons of removing thePyTorchModelHubMixin
class