Repository navigation
fix(auto): preserve speaker dependency import failures - #3788
Open
monsterlag wants to merge 1 commit into
Open
monsterlag wants to merge 1 commit into
monsterlag wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Note
AI-generated, not reviewed by a human. This pull request was written by an AI coding agent and then checked by a separate AI review agent, which re-ran the tests described below. No human has reviewed the code. It is submitted by @monsterlag, who runs these agents. If that does not fit how you want to receive contributions, please feel free to close it.
Summary
spk_model="cam++"could raiseNameError: name 'ClusterBackend' is not definedinstead of showing the dependency problem.ImportErrorbefore constructing the speaker model. Check the resolved configuration so this works for both constructor arguments andconfig.yaml; ASR-only construction remains available.Type of change
Validation
python -m compileall funasr examples testsLinux aarch64, Python 3.11.2, torch/torchaudio 2.10.0+cpu, NumPy 2.4.6. From the repository root with the development environment activated:
Results: 179 passed, 1 deselected, 10 subtests passed. Compilation, test-file formatting and whitespace checks passed. The deselected existing test downloads pretrained models. The four config-supplied dependency-failure cases reproduce the
NameErrorwith the earlier constructor-only guard; all ten speaker regressions pass with the resolved-configuration check.Validation limitations:
python -m pytest -p no:cacheprovider -q tests/test_auto_model_ncpu.pyreports 4 failed, 3 passed on both this change and the untouched baseline. This ARM environment reports mixed BLAS thread counts; no BLAS code was changed.auto_model.pyfails on existing formatting. The changed import and guard blocks pass Black 24.4.0 at 100 columns separately; unrelated formatting is untouched.User impact
Users requesting speaker diarization can see the original dependency failure rather than an undefined-name error, including when the speaker model is selected through configuration. Users not requesting speaker support are unaffected.
Notes for reviewers
This fixes diagnostic masking, not the unidentified dependency failure in the reporter's Windows installation. Tests exercise real configuration resolution and backend construction with local stand-in models; no Windows, GPU, real-checkpoint inference or diarization-quality validation is claimed. The original issue still needs reporter-environment confirmation.