chaiNNer-org / spandrel

Spandrel gives your project support for various PyTorch architectures meant for AI Super-Resolution, restoration, and inpainting. Based on the model support implemented in chaiNNer.
MIT License
138 stars 12 forks source link

Error-tolerant loading for `.pt` files #215

Closed RunDevelopment closed 6 months ago

RunDevelopment commented 6 months ago

A lot of the .pt files I downloaded were actually .pth files. Since this seems to be a common problem, I added support for this in ModelLoader#load_state_dict_from_file. When we fail to load a .pt file, we will now try to load it as a .pth file.

Other changes: