Added support for launching on Apple Silicon

This commit is contained in:
xeonvs
2022-09-07 15:58:25 +02:00
parent 15bb8e8057
commit 65fbefd033
4 changed files with 17 additions and 6 deletions

View File

@@ -14,8 +14,11 @@ import modules.images
def load_model(filename):
# this code is adapted from https://github.com/xinntao/ESRGAN
pretrained_net = torch.load(filename)
if torch.has_mps:
map_l = 'cpu'
else:
map_l = None
pretrained_net = torch.load(filename, map_location=map_l)
crt_model = arch.RRDBNet(3, 3, 64, 23, gc=32)
if 'conv_first.weight' in pretrained_net: