Fix PyTorch 2.6+ compatibility for pyannote speaker detection#252
Open
MatthiasHeim wants to merge 1 commit intokaixxx:mainfrom
Open
Fix PyTorch 2.6+ compatibility for pyannote speaker detection#252MatthiasHeim wants to merge 1 commit intokaixxx:mainfrom
MatthiasHeim wants to merge 1 commit intokaixxx:mainfrom
Conversation
PyTorch 2.6 changed the default value of `weights_only` in `torch.load()` from `False` to `True`, which breaks loading pyannote model checkpoints that contain pickled objects like `Specifications`, `Problem`, and `Resolution` classes. This fix adds the required classes to `torch.serialization.safe_globals` before loading the pyannote pipeline, allowing speaker detection to work with PyTorch 2.6+ and pyannote.audio 4.x. Changes: - Add safe globals for pyannote and omegaconf classes in pyannote_mp_worker.py - Add omegaconf to requirements files (needed for ListConfig/DictConfig) Fixes issue related to: pyannote/pyannote-audio#1908 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Owner
|
On what system are you working? I have not seen this error on Windows or macOS (arm). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
weights_only=Truedefault changeomegaconfto requirements filesProblem
PyTorch 2.6 changed the default value of
weights_onlyintorch.load()fromFalsetoTrue. This breaks loading pyannote model checkpoints that contain pickled objects likeSpecifications,Problem, andResolutionclasses.Error message:
Solution
Add the required classes to
torch.serialization.safe_globalsbefore loading the pyannote pipeline inpyannote_mp_worker.py:Test plan
Related issues
🤖 Generated with Claude Code