fix(diarizer): honor configuration.computeUnits in OfflineDiarizerModels.load#743
Open
chadneal wants to merge 1 commit into
Open
fix(diarizer): honor configuration.computeUnits in OfflineDiarizerModels.load#743chadneal wants to merge 1 commit into
chadneal wants to merge 1 commit into
Conversation
…els.load OfflineDiarizerModels.load(from:configuration:progressHandler:) accepted a `configuration: MLModelConfiguration?` but never read it, hardcoding the inference compute units to `.all`. The streaming `DiarizerModels` loader already honors a caller-supplied configuration (covered by `testModelLoadingCustomConfig`); this brings the offline loader in line. The default stays `.all`, so existing callers are unaffected. Callers that need CPU/GPU-only inference (e.g. to avoid cross-device ANE numeric variance in the WeSpeaker embeddings) can now pass `MLModelConfiguration(computeUnits:)`. The fbank front-end intentionally stays on `.cpuOnly`. Adds `testOfflineModelLoadingCustomConfig` mirroring the existing streaming test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes #742.
OfflineDiarizerModels.load(from:configuration:progressHandler:)accepts aconfiguration: MLModelConfiguration?but ignored it, always loading the segmentation / embedding / PLDA-rho models with.all. The streamingDiarizerModelsloader already honors a caller-supplied configuration (testModelLoadingCustomConfig); this brings the offline loader in line.Change
.all) — no behavior change for existing callers.MLModelConfiguration(computeUnits:)..cpuOnly.Test
Adds
testOfflineModelLoadingCustomConfigmirroring the existing streamingtestModelLoadingCustomConfig, asserting the segmentation / embedding / PLDA-rho models load with the requested compute units.swift build --build-testspasses locally.