openclimatefix / PVNet

PVnet main repo
MIT License
21 stars 5 forks source link

Saving model to HF broken _save_pretrained method doesn't exist #249

Closed Sukh-P closed 3 months ago

Sukh-P commented 3 months ago

Describe the bug

Currently when trying to save a model to HF with the code in the main branch one would encounter this error:

AttributeError: 'Model' object has no attribute '_save_pretrained'

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 method

So I think there are two ways this could be fixed:

peterdudfield commented 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?

Sukh-P commented 3 months ago

@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 😄

peterdudfield commented 3 months ago

ah, not sure, my mistale for not testing it properly, is it easy to put back in?

Sukh-P commented 3 months ago

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