Spaces:
Running on Zero
Running on Zero
Download _utils/load_models.py from VisionLanguageGroup/MicroscopyMatching: direct link, hf CLI and curl.
- Browser
- Download file 396 Bytes
-
https://huggingface.co/spaces/VisionLanguageGroup/MicroscopyMatching/resolve/02e04fb58d0f2b9f11eb4a73a3d31ffecfcb88eb/_utils/load_models.py
- Command line
-
hf download hf://spaces/VisionLanguageGroup/MicroscopyMatching@02e04fb58d0f2b9f11eb4a73a3d31ffecfcb88eb/_utils/load_models.py
-
curl -L -o load_models.py https://huggingface.co/spaces/VisionLanguageGroup/MicroscopyMatching/resolve/02e04fb58d0f2b9f11eb4a73a3d31ffecfcb88eb/_utils/load_models.py
396 Bytes
| from config import RunConfig | |
| import torch | |
| from diffusers.pipelines.stable_diffusion import StableDiffusionPipeline | |
| import torch.nn as nn | |
| def load_stable_diffusion_model(config: RunConfig): | |
| device = torch.device('cpu') | |
| stable_diffusion_version = "CompVis/stable-diffusion-v1-4" | |
| stable = StableDiffusionPipeline.from_pretrained(stable_diffusion_version).to(device) | |
| return stable | |