CoolFace
Apppublic

mosibi/RVC_HFv2

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
LazyImport.py13 linesDownload Raw Back to root
1from importlib.util import find_spec, LazyLoader, module_from_spec2from sys import modules3 4def lazyload(name):5    if name in modules:6        return modules[name]7    else:8        spec = find_spec(name)9        loader = LazyLoader(spec.loader)10        module = module_from_spec(spec)11        modules[name] = module12        loader.exec_module(module)13        return module