Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -30,6 +30,8 @@ import open_clip
|
|
30 |
def load_model_from_config(config, ckpt, verbose=False):
|
31 |
print(f"Loading model from {ckpt}")
|
32 |
pl_sd = torch.load(ckpt, map_location="cuda")
|
|
|
|
|
33 |
sd = pl_sd["state_dict"]
|
34 |
model = instantiate_from_config(config.model)
|
35 |
m, u = model.load_state_dict(sd, strict=False)
|
|
|
30 |
def load_model_from_config(config, ckpt, verbose=False):
|
31 |
print(f"Loading model from {ckpt}")
|
32 |
pl_sd = torch.load(ckpt, map_location="cuda")
|
33 |
+
#please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
|
34 |
+
pl_sd = torch.load(ckpt, map_location=torch.device('cpu'))
|
35 |
sd = pl_sd["state_dict"]
|
36 |
model = instantiate_from_config(config.model)
|
37 |
m, u = model.load_state_dict(sd, strict=False)
|