1 Commits
Author SHA1 Message Date
Palash DebnathandClaude Opus 4.8 c993e14072 fix(diarization): use_auth_token->token shim for pyannote on HF Hub 1.x (#167) (#168)
* fix(diarization): shim use_auth_token->token for pyannote on HF Hub 1.x (#167)

pyannote-audio 3.x (pipeline.py:102) calls hf_hub_download(use_auth_token=...),
which huggingface_hub 1.x removed (only 'token' now) -> 'unexpected keyword
argument use_auth_token', breaking speaker diarization. Wrap hf_hub_download/
snapshot_download to translate the dead kwarg, applied before pyannote's
'from huggingface_hub import hf_hub_download' binds it (+ patch already-loaded
pyannote modules). Verified the real pyannote reference binds the shim.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(diarization): use pytest.importorskip (fixes CodeQL uninitialized-local)

CodeQL doesn't model pytest.skip() as no-return, so it flagged _pp as a
possibly-uninitialized local (py/uninitialized-local-variable, error). Switch
to pytest.importorskip — cleaner and CodeQL-clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 17:11:44 +05:30