MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / command_install

Function command_install

tools/model_manager.py:1993–2018  ·  view source on GitHub ↗
(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

1991 raise RuntimeError(f"checkpoint state_dict must be a dict, got {type(state).__name__}")
1992 return state
1993
1994
1995def install_demucs_import_stubs() -> None:
1996 if "demucs.htdemucs" not in sys.modules:
1997 demucs_pkg = sys.modules.get("demucs")
1998 if demucs_pkg is None:
1999 demucs_pkg = types.ModuleType("demucs")
2000 demucs_pkg.__path__ = [] # type: ignore[attr-defined]
2001 sys.modules["demucs"] = demucs_pkg
2002 htdemucs = types.ModuleType("demucs.htdemucs")
2003
2004 class HTDemucs:
2005 pass
2006
2007 htdemucs.HTDemucs = HTDemucs
2008 sys.modules["demucs.htdemucs"] = htdemucs
2009 setattr(demucs_pkg, "htdemucs", htdemucs)
2010
2011 if "openunmix.filtering" not in sys.modules:
2012 filtering = types.ModuleType("openunmix.filtering")
2013
2014 def _wiener_stub(*_args: Any, **_kwargs: Any) -> Any:
2015 raise RuntimeError("openunmix.filtering.wiener stub should not be called during Demucs conversion")
2016
2017 filtering.wiener = _wiener_stub
2018 openunmix = types.ModuleType("openunmix")
2019 openunmix.filtering = filtering
2020 sys.modules["openunmix"] = openunmix
2021 sys.modules["openunmix.filtering"] = filtering

Callers 1

mainFunction · 0.85

Calls 6

install_snapshotFunction · 0.85
install_converterFunction · 0.85
printFunction · 0.85
resolve_pathFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected