File size: 1,158 Bytes
63dd946 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # 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
|