Download model.py from User-2468/mini-unet-colorizer: direct link, hf CLI and curl.
- Browser
- Download file 420 Bytes
-
https://huggingface.co/User-2468/mini-unet-colorizer/resolve/915de375b4f97d217f62fedcf467e8a4e52b3094/model.py
- Command line
-
hf download hf://User-2468/mini-unet-colorizer@915de375b4f97d217f62fedcf467e8a4e52b3094/model.py
-
curl -L -o model.py https://huggingface.co/User-2468/mini-unet-colorizer/resolve/915de375b4f97d217f62fedcf467e8a4e52b3094/model.py
420 Bytes
| from pathlib import Path | |
| from semantic_model import SemanticColorizer, load_semantic, save_semantic | |
| def load_model(source, revision=None, device="cpu"): | |
| from huggingface_hub import snapshot_download | |
| path=Path(source) | |
| if not path.is_dir(): path=Path(snapshot_download(source,revision=revision,allow_patterns=["config.json","model.safetensors"])) | |
| return load_semantic(path,device) | |
| save_model=save_semantic | |