Spaces:
Paused
Paused
Commit ·
0daeefc
1
Parent(s): d5b9c19
mps
Browse files37 unmodified lines38394041424344103 unmodified lines14814915015137 unmodified linescfg = dict2namespace(config)device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")model = instructir.create_model(input_channels =cfg.model.in_ch, width=cfg.model.width, enc_blks = cfg.model.enc_blks,middle_blk_num = cfg.model.middle_blk_num, dec_blks = cfg.model.dec_blks, txtdim=cfg.model.textdim)model = model.to(device)103 unmodified lines)if __name__ == "__main__":demo.launch()37 unmodified lines3839404142434445464748495051103 unmodified lines15515615715837 unmodified linescfg = dict2namespace(config)#device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")if torch.backends.mps.is_available():device = "mps"torch_dtype = torch.float32elif torch.cuda.is_available():device = "cuda"else:device = "cpu"model = instructir.create_model(input_channels =cfg.model.in_ch, width=cfg.model.width, enc_blks = cfg.model.enc_blks,middle_blk_num = cfg.model.middle_blk_num, dec_blks = cfg.model.dec_blks, txtdim=cfg.model.textdim)model = model.to(device)103 unmodified lines)if __name__ == "__main__":demo.launch()
app.py+9-2