Spaces:
Running on Zero
Running on Zero
Download src/build_pipe.py from mikonvergence/MESA: direct link, hf CLI and curl.
- Browser
- Download file 574 Bytes
-
https://huggingface.co/spaces/mikonvergence/MESA/resolve/main/src/build_pipe.py
- Command line
-
hf download hf://spaces/mikonvergence/MESA/src/build_pipe.py
-
curl -L -o build_pipe.py https://huggingface.co/spaces/mikonvergence/MESA/resolve/main/src/build_pipe.py
574 Bytes
| from .pipeline_terrain import TerrainDiffusionPipeline | |
| from huggingface_hub import hf_hub_download, snapshot_download | |
| import os | |
| import torch | |
| def build_pipe(): | |
| print('Downloading weights...') | |
| try: | |
| os.mkdir('./weights/') | |
| except: | |
| True | |
| snapshot_download(repo_id="NewtNewt/MESA", local_dir="./weights") | |
| weight_path = './weights' | |
| print('[DONE]') | |
| print('Instantiating Model...') | |
| pipe = TerrainDiffusionPipeline.from_pretrained(weight_path, torch_dtype=torch.float16) | |
| pipe.to("cuda") | |
| print('[DONE]') | |
| return pipe |