Download src/utils/__init__.py from kaupane/Inko: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/spaces/kaupane/Inko/resolve/main/src/utils/__init__.py
- Command line
-
hf download hf://spaces/kaupane/Inko/src/utils/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/kaupane/Inko/resolve/main/src/utils/__init__.py
648 Bytes
| """Utility helpers with lazy imports for data-only environments.""" | |
| __all__ = ["encode_text", "encode_image", "decode_latents", "get_vae_stats"] | |
| _LAZY = { | |
| "encode_text": (".encode_text", "encode_text"), | |
| "encode_image": (".vae_codec", "encode_image"), | |
| "decode_latents": (".vae_codec", "decode_latents"), | |
| "get_vae_stats": (".vae_codec", "get_vae_stats"), | |
| } | |
| def __getattr__(name): | |
| if name in _LAZY: | |
| import importlib | |
| module_name, attribute = _LAZY[name] | |
| return getattr(importlib.import_module(module_name, __name__), attribute) | |
| raise AttributeError(f"module {__name__!r} has no attribute {name!r}") | |