Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions latent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@
" print(latent_diffusion_model)\n",
" model = instantiate_from_config(config.model)\n",
" if(latent_diffusion_model != \"finetuned\"):\n",
" sd = torch.load(ckpt, map_location=\"cuda\")[\"state_dict\"]\n",
" sd = torch.load(ckpt, map_location=device)[\"state_dict\"]\n",
" m, u = model.load_state_dict(sd, strict = False)\n",
" \n",
" if(latent_diffusion_model == \"finetuned\"): \n",
" sd = torch.load(f\"{model_path}/txt2img-f8-large-jack000-finetuned-fp16.ckpt\",map_location=\"cuda\")\n",
" sd = torch.load(f\"{model_path}/txt2img-f8-large-jack000-finetuned-fp16.ckpt\",map_location=device)\n",
" m, u = model.load_state_dict(sd, strict = False)\n",
" #model.model = model.model.half().eval().to(device)\n",
" \n",
Expand Down Expand Up @@ -410,7 +410,7 @@
" print(\"unexpected keys:\")\n",
" print(u)\n",
"\n",
" model.requires_grad_(False).half().eval().to('cuda')\n",
" model.requires_grad_(False).half().eval().to(device)\n",
" return model\n",
"\n",
"config = OmegaConf.load(\"./latent-diffusion/configs/latent-diffusion/txt2img-1p4B-eval.yaml\") # TODO: Optionally download from same location as ckpt and chnage this logic\n",
Expand Down
Loading