Spaces:
Sleeping
Sleeping
Launch seven-model molecular playground with ZeroGPU, property controls, 3D viewing and downloads
3e3ee14 verified Download runtime/morph/config.py from maltefranke/morph-playground: direct link, hf CLI and curl.
- Browser
- Download file 704 Bytes
-
https://huggingface.co/spaces/maltefranke/morph-playground/resolve/main/runtime/morph/config.py
- Command line
-
hf download hf://spaces/maltefranke/morph-playground/runtime/morph/config.py
-
curl -L -o config.py https://huggingface.co/spaces/maltefranke/morph-playground/resolve/main/runtime/morph/config.py
704 Bytes
| """Shared OmegaConf resolver registration. | |
| Importing this module registers Morph's custom resolvers. Registration is | |
| idempotent so entry points and libraries can safely import it in any order. | |
| """ | |
| from omegaconf import OmegaConf | |
| def register_resolvers() -> None: | |
| """Register the resolvers used by Morph's Hydra configurations.""" | |
| resolvers = { | |
| "oc.eval": eval, | |
| "len": len, | |
| "if": lambda condition, true, false: true if condition else false, | |
| "eq": lambda left, right: left == right, | |
| } | |
| for name, resolver in resolvers.items(): | |
| if not OmegaConf.has_resolver(name): | |
| OmegaConf.register_new_resolver(name, resolver) | |
| register_resolvers() | |