fix: load Parakeet from Pindrop's model cache - #87
Open
farooqu wants to merge 2 commits into
Open
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019faf49-fe61-7460-9e21-c2114a2659df Co-authored-by: Umer Farooq <umer@thefarooqs.net>
Amp-Thread-ID: https://ampcode.com/threads/T-019faf49-fe61-7460-9e21-c2114a2659df Co-authored-by: Umer Farooq <umer@thefarooqs.net>
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
Fix Parakeet activation so Pindrop loads the model from the same Pindrop-owned cache used for download and discovery, rather than silently starting a second FluidAudio download.
Fixes #86.
Problem
Pindrop reported
parakeet-tdt-0.6b-v3as installed, then remained in model loading until the fixed 120-second watchdog fired. Recordings afterward failed withmodelNotLoaded.The two conflicting roots were:
~/Library/Application Support/Pindrop/FluidInference/parakeet-coreml/~/Library/Application Support/FluidAudio/Models/TranscriptionServicesupplied Pindrop's Application Support root to the engine, butParakeetEngine.loadModel(name:downloadBase:)ignored it and called FluidAudio's no-directory overload.Runtime evidence
A clean runtime experiment removed the Parakeet directories from FluidAudio's shared cache and launched Pindrop once. FluidAudio created only
parakeet-tdt-0.6b-v3; after 30 seconds it contained about 24 MB, with a decoder, an incomplete encoder, and no preprocessor, joint model, or vocabulary.Copying the complete ~461 MB Pindrop-owned cache into that exact FluidAudio runtime location—with no code or settings change—made the released app load successfully in 12.03 seconds instead of timing out. This confirmed that activation was ignoring Pindrop's complete model and starting a duplicate download.
History and root cause
The split dates to the original integration:
ParakeetEngineusing the no-directory overload despite acceptingdownloadBase.downloadAndLoad(to:version:)in Pindrop's tree.FluidAudio's
to:overload already existed before 0.15. FluidAudio 7f1e006 later changed the default localRepo.folderNamerule to remove-coreml. Pindrop's 075afb1 adoption of FluidAudio 0.15.4 updated manager/decoder APIs but retained the engine's no-directory call.At pinned FluidAudio
b9d43724,AsrModels.downloadAndLoad(to:)takes the supplied URL's parent andDownloadUtilsappendsRepo.folderName. Thus the canonical local leaves are suffix-less even when the supplied URL or remote repository name contains-coreml.Fix
Repo.folderName.AsrModels.downloadAndLoad(to:version:)during activation.AsrModels.modelsExist(at:version:)so partial artifact sets are not advertised as installed.When Pindrop supplies
downloadBase, activation no longer uses or creates the FluidAudio shared Parakeet cache.Migration and compatibility
If the canonical suffix-less Pindrop directory is absent and the old suffixed sibling exists, Pindrop moves the legacy directory to the canonical name. This is a same-volume rename rather than a second ~461 MB copy.
If the canonical destination already exists, migration does nothing: it does not overwrite, merge, delete, or reconcile the directories. Move failures are logged and leave the legacy directory intact. FluidAudio's separate shared cache is never migrated or deleted.
Tests
Added network-free temporary-directory coverage for:
Repo.folderName;Validation performed here:
git diff --check upstream/main— passed.b9d43724source inspected for its folder-name and custom-directory behavior.just buildandjust testrequire macOS/Xcode and were not runnable in the Linux orb used to prepare this change. The fork's configured macOS workflow did not enqueue, so this PR does not claim a passing macOS run yet.Non-goals