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/1cca2ddeb5f7c0e6167c452f52541c7684182248/model.py
- Command line
-
hf download hf://User-2468/mini-unet-colorizer@1cca2ddeb5f7c0e6167c452f52541c7684182248/model.py
-
curl -L -o model.py https://huggingface.co/User-2468/mini-unet-colorizer/resolve/1cca2ddeb5f7c0e6167c452f52541c7684182248/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 | |