Download src/tests/refpkg.py from CIIL/Anuvani-Diarization: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/CIIL/Anuvani-Diarization/resolve/main/src/tests/refpkg.py
- Command line
-
hf download hf://CIIL/Anuvani-Diarization/src/tests/refpkg.py
-
curl -L -o refpkg.py https://huggingface.co/CIIL/Anuvani-Diarization/resolve/main/src/tests/refpkg.py
1.16 kB
| # Copyright (c) 2026 The Anuvani-Diarization authors | |
| # SPDX-License-Identifier: MIT OR Apache-2.0 | |
| """The frozen release package (release/anuvani_diar_v1/anuvani_diar_ref), imported from its own folder under the alias | |
| `anuvani_diar_ref` so it can sit beside the new `anuvani_diar` package. Nothing is copied or edited.""" | |
| import importlib.util | |
| import os | |
| import sys | |
| from pathlib import Path | |
| # ANUVANI_DIAR_MAIN_TREE: see conftest.py (a linked git worktree reads the release's weights in the main checkout) | |
| REL = Path(os.environ.get("ANUVANI_DIAR_MAIN_TREE") or Path(__file__).resolve().parents[3]) / "release/anuvani_diar_v1" | |
| def load(): | |
| if "anuvani_diar_ref" in sys.modules: | |
| return sys.modules["anuvani_diar_ref"] | |
| spec = importlib.util.spec_from_file_location("anuvani_diar_ref", REL / "anuvani_diar_ref/__init__.py", | |
| submodule_search_locations=[str(REL / "anuvani_diar_ref")]) | |
| mod = importlib.util.module_from_spec(spec) | |
| sys.modules["anuvani_diar_ref"] = mod | |
| spec.loader.exec_module(mod) | |
| from anuvani_diar_ref import vbx | |
| vbx._HUB[0] = REL / "bundle/hub" | |
| return mod | |