Repository navigation
Intel changes - #51
Conversation
- Changed ARCHS from arm64-only to - Removed x86_64 from EXCLUDED_ARCHS - Added SwiftWhisper package dependency for Intel fallback - Updated signing configuration for release builds
WalkthroughThis PR adds SwiftWhisper as a new SPM dependency and implements a provider-based ASR architecture with FluidAudio (ARM64) and Whisper (Intel) providers, refactors ASRService to use providers/ThreadSafeAudioBuffer/TranscriptionExecutor, updates build settings, and bumps app version to 1.5.1. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant ContentView
participant SettingsStore
participant ASRService
participant Provider
participant Models
participant Audio
User->>ContentView: Choose provider / Start recording
ContentView->>SettingsStore: Update/read selectedTranscriptionProvider
ContentView->>ASRService: ensureAsrReady()
ASRService->>SettingsStore: Read selection
ASRService->>ASRService: Select provider (FluidAudio/Whisper)
ASRService->>Provider: prepare(progressHandler)
Provider->>Models: Check/download models
Models-->>Provider: Models ready
Provider-->>ASRService: isReady
ContentView->>ASRService: start()
Audio->>ASRService: stream samples
ASRService->>ASRService: Buffer samples (ThreadSafeAudioBuffer)
ContentView->>ASRService: stop()
ASRService->>ASRService: Serialize via TranscriptionExecutor
ASRService->>Provider: transcribe(audioChunk)
Provider->>Models: Run inference
Models-->>Provider: Transcription result
Provider-->>ASRService: ASRTranscriptionResult
ASRService-->>ContentView: Display transcript
alt Provider error
Provider-->>ASRService: throws
ASRService->>ContentView: set errorTitle/errorMessage/showError
ContentView-->>User: show alert
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Sources/Fluid/Networking/ModelDownloader.swift (1)
356-360: Hardcoded repository name breaks configurability.The vocabulary path construction hardcodes
"parakeet-tdt-0.6b-v3-coreml", which contradicts the class design that allows customowner/repovia the initializer. If a different repository is configured, this path will be incorrect.Consider loading the vocabulary from within
repoDirectorydirectly, similar to how other model files are loaded:- let vocabPath = repoDirectory.deletingLastPathComponent().appendingPathComponent("parakeet-tdt-0.6b-v3-coreml").appendingPathComponent("parakeet_v3_vocab.json") + let vocabPath = repoDirectory.appendingPathComponent("parakeet_v3_vocab.json")If the vocabulary must be in a parent directory for some reason, consider using the instance's
repoproperty instead of a hardcoded string.
🧹 Nitpick comments (9)
Sources/Fluid/Networking/ModelDownloader.swift (1)
352-354: Add existence checks for decoder and joint models for consistent error handling.The function checks for encoder/preprocessor existence but loads decoder and joint without validation. If these files are missing, users will get a cryptic
MLModelerror instead of a clear message like the one at line 346-349.// Load decoder and joint (same for both structures) + guard fm.fileExists(atPath: decUrl.path) else { + throw NSError(domain: "ModelDL", code: -1, userInfo: [ + NSLocalizedDescriptionKey: "Decoder model not found at \(decUrl.path)" + ]) + } + guard fm.fileExists(atPath: jointUrl.path) else { + throw NSError(domain: "ModelDL", code: -1, userInfo: [ + NSLocalizedDescriptionKey: "JointDecision model not found at \(jointUrl.path)" + ]) + } let decoder = try MLModel(contentsOf: decUrl, configuration: config) let joint = try MLModel(contentsOf: jointUrl, configuration: config)Sources/Fluid/Persistence/SettingsStore.swift (1)
769-791: Clean implementation, but address SwiftLint warnings.The transcription provider enum is well-designed with clear display names and descriptions. However, the string enum values are redundant when they match the case names.
Apply this diff to address the SwiftLint warnings:
enum TranscriptionProviderOption: String, CaseIterable, Identifiable { - case auto = "auto" - case fluidAudio = "fluidAudio" - case whisper = "whisper" + case auto + case fluidAudio + case whisperBased on learnings, SwiftLint flagged redundant string enum values.
Sources/Fluid/Services/WhisperProvider.swift (1)
23-52: WhisperProvider model lifecycle looks solid; consider minor robustness/UX tweaksOverall the provider wiring (cache location, download, load, cache clearing) looks correct and matches the TranscriptionProvider contract.
Two small follow‑ups you might consider:
modelURLforce‑unwraps the caches directory (.first!). It’s extremely unlikely to be nil, but you could defensively fall back (or throw a clear error) instead of crashing if the URL lookup ever fails in unusual sandboxed contexts.prepare(progressHandler:)forwards the closure todownloadModel, butdownloadModeldoesn’t currently report progress. Either wire progress into a customURLSession/delegate pipeline or, if that’s not planned, document that progress isn’t used so callers don’t expect updates.Also applies to: 84-134
Sources/Fluid/UI/SettingsView.swift (1)
567-648: Transcription Engine card correctly drives provider selection; only minor state-source nitThe card cleanly reflects
asr.activeProviderName, shows an architecture badge, and uses a Picker bound toSettingsStore.shared.selectedTranscriptionProvider, callingasr.resetTranscriptionProvider()so the new provider takes effect on next use. That matches the new provider architecture.If you want to tighten separation of concerns later, you could have ASRService expose the selected provider (and perhaps the architecture label) instead of reading
SettingsStore.shareddirectly in the view, keeping persistence/selection logic in one place.Sources/Fluid/Services/MeetingTranscriptionService.swift (1)
3-8: Confirm Apple‑Silicon‑only file transcription behavior and clean up duplicate imports
import AVFoundationandimport Combineare now each imported twice. It’s harmless but worth pruning for clarity.- With the new
#if arch(arm64)block, file transcription:
- Only runs via
asrService.asrManageron Apple Silicon (FluidAudio).- Always throws
TranscriptionError.transcriptionFailed("File transcription is only supported on Apple Silicon Macs at this time.")on non‑arm64.- On Apple Silicon, if the selected transcription provider is Whisper,
asrService.asrManagerwill benil, and you’ll hit theASR Manager not initializederror path.If the intent is “Meeting transcription only works with FluidAudio on Apple Silicon,” this is fine but might merit a more specific user‑facing error (and possibly UI gating). If you eventually want meeting transcription to respect the same provider abstraction as streaming/real‑time ASR, this would be the main place to refactor toward calling the
TranscriptionProviderinstead of FluidAudio directly.Also applies to: 99-150
Sources/Fluid/Services/FluidAudioProvider.swift (1)
20-77: FluidAudioProvider wrapper looks correct; progressHandler currently unusedThe arm64 implementation cleanly wraps
AsrModels.downloadAndLoad()andAsrManager, tracks readiness, and manages both v2/v3 CoreML caches. The Intel shim appropriately advertises itself as unavailable and throws fromprepare/transcribe, matching the provider‑selection logic in ASRService.One small improvement:
prepare(progressHandler:)ignores the progress callback. If you ever want to surface model‑download/load progress in the UI (similar to the ASR settings card), plumbing this through toAsrModelswould make the API more meaningful. If you don’t plan to support progress here, consider documenting that the handler is not called to avoid false expectations.Also applies to: 79-92
Sources/Fluid/Services/ASRService.swift (3)
11-27: TranscriptionExecutor correctly serializes CoreML calls; document non‑reentrancy assumptionThe actor’s
lastTaskchaining effectively enforces strict serialization of transcription operations and shields CoreML from concurrent access.One thing to be explicit about: if any future code calls
transcriptionExecutor.runfrom inside an operation already running underrun, it will deadlock (inner task waits onpreviouswhich is the outer task). Today your providers don’t do this, so it’s safe, but a short doc comment or assertion warning against re‑entrant use would help future maintainers avoid accidental misuse.
76-80: Provider abstraction and ensureAsrReady single‑flight look good; small state/UX tweaks
- The FluidAudio/Whisper provider selection via
SettingsStore.shared.selectedTranscriptionProviderandCPUArchitecture.isAppleSiliconis clean, and the single‑flightensureAsrReadylogic (ensureReadyTask+ensureReadyProviderKey) correctly prevents overlappingprepare()calls for a given provider.checkIfModelsExist()now delegates totranscriptionProvider.modelsExistOnDisk(), which is correct per‑provider. When you callresetTranscriptionProvider(), you currently forcemodelsExistOnDisk = false; if you want the “Model cached” indicator to accurately reflect the newly selected provider immediately, consider invokingcheckIfModelsExist()there instead of hard‑resetting to false.- Inside
performEnsureAsrReady, you’re already on the@MainActorbut still wrap UI state changes (isDownloadingModel,isLoadingModel,modelsExistOnDisk) inDispatchQueue.main.async. You can safely assign these properties directly and drop the extra dispatch, which simplifies the code and keeps updates strictly ordered with the rest of the main‑actor logic.clearModelCache()delegates totranscriptionProvider.clearCache(), so the “Delete models” button in the UI effectively applies to whichever provider is currently active. If the intent is “delete models for current engine,” this is perfect; if instead you want a global cache purge (both FluidAudio and Whisper), you might add a helper that callsclearCache()on both providers when present.The error fields (
errorTitle,errorMessage,showError) wired instop()andpredownloadSelectedModel()are also a good fit for the newContentViewalert and keep user‑visible error handling scoped to explicit failure points.Also applies to: 90-97, 98-164, 176-189, 246-250, 636-767, 769-791, 807-813
186-189: ThreadSafeAudioBuffer integration fixes mutation races; revisit streaming startup semantics
- Replacing the raw
[Float]buffer withThreadSafeAudioBufferand usingappend,getAll,getPrefix, andclearinprocessInputBuffer,stop,stopWithoutTranscription, and streaming logic is a solid fix for the “Array mutation while enumerating” / cross‑thread mutation issues during long sessions.- In
processStreamingChunk, you now takeaudioBuffer.countand passaudioBuffer.getPrefix(currentSampleCount)intotranscriptionExecutor.run, which is fine as long asgetPrefixis cheap enough (you’re effectively re‑transcribing the accumulated audio each time, relying onsmartDiffUpdateto smooth the UI). If streaming performance ever regresses on slower machines, consider switching to a “take and trim” API to process only new samples per chunk.startStreamingTranscription()still bails out whenisAsrReadyis false. Given thatContentView.startRecording()starts the engine and then callsensureAsrReady()in a backgroundTask, the first recording session on a fresh install may have no streaming preview until the user stops and restarts after models are ready. If you want streaming on the very first run, you may want to (re)start streaming onceensureAsrReady()completes successfully.Also applies to: 298-305, 365-368, 419-420, 512-525, 868-887, 913-915
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
Fluid.xcodeproj/project.pbxproj(18 hunks)Fluid.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved(2 hunks)Info.plist(1 hunks)Package.resolved(1 hunks)Package.swift(2 hunks)Sources/Fluid/ContentView.swift(1 hunks)Sources/Fluid/Networking/ModelDownloader.swift(3 hunks)Sources/Fluid/Persistence/SettingsStore.swift(2 hunks)Sources/Fluid/Services/ASRService.swift(14 hunks)Sources/Fluid/Services/FluidAudioProvider.swift(1 hunks)Sources/Fluid/Services/MeetingTranscriptionService.swift(3 hunks)Sources/Fluid/Services/ThreadSafeAudioBuffer.swift(1 hunks)Sources/Fluid/Services/TranscriptionProvider.swift(1 hunks)Sources/Fluid/Services/WhisperProvider.swift(1 hunks)Sources/Fluid/UI/SettingsView.swift(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
Sources/Fluid/Services/TranscriptionProvider.swift (2)
Sources/Fluid/Services/FluidAudioProvider.swift (6)
prepare(20-35)prepare(85-87)transcribe(37-45)transcribe(89-91)modelsExistOnDisk(47-51)clearCache(53-70)Sources/Fluid/Services/WhisperProvider.swift (4)
prepare(32-52)transcribe(54-68)modelsExistOnDisk(70-72)clearCache(74-80)
Sources/Fluid/Services/WhisperProvider.swift (1)
Sources/Fluid/Services/TranscriptionProvider.swift (2)
modelsExistOnDisk(49-49)clearCache(50-50)
Sources/Fluid/UI/SettingsView.swift (1)
Sources/Fluid/Services/ASRService.swift (1)
resetTranscriptionProvider(157-164)
Sources/Fluid/Services/FluidAudioProvider.swift (4)
Sources/Fluid/Services/WhisperProvider.swift (4)
prepare(32-52)transcribe(54-68)modelsExistOnDisk(70-72)clearCache(74-80)Sources/Fluid/Services/DebugLogger.swift (1)
info(133-135)Sources/Fluid/Services/ASRService.swift (1)
initialize(224-244)Sources/Fluid/Services/TranscriptionProvider.swift (2)
modelsExistOnDisk(49-49)clearCache(50-50)
🪛 SwiftLint (0.57.0)
Sources/Fluid/Persistence/SettingsStore.swift
[Warning] 770-770: String enum values can be omitted when they are equal to the enumcase name
(redundant_string_enum_value)
[Warning] 771-771: String enum values can be omitted when they are equal to the enumcase name
(redundant_string_enum_value)
[Warning] 772-772: String enum values can be omitted when they are equal to the enumcase name
(redundant_string_enum_value)
Sources/Fluid/Networking/ModelDownloader.swift
[Warning] 3-3: Imports should be unique
(duplicate_imports)
🔇 Additional comments (18)
Sources/Fluid/Networking/ModelDownloader.swift (1)
302-386: LGTM on the overall structure and conditional compilation.The ARM64-gated extension with fallback support for legacy model structures is well-designed. The version detection logic and verbose logging will help with debugging model loading issues.
Info.plist (1)
14-14: LGTM! Version bump aligns with the release.The version update to 1.5.1 is consistent with the MARKETING_VERSION changes in the project configuration.
Fluid.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (2)
94-102: LGTM! SwiftWhisper correctly pinned to version 1.2.0.This Package.resolved correctly pins SwiftWhisper to a semantic version (1.2.0) with a specific revision, ensuring reproducible builds. This is the proper approach that should also be applied to Package.swift and the root Package.resolved.
2-2: OriginHash update is expected.The originHash change reflects the addition of the SwiftWhisper dependency.
Sources/Fluid/Persistence/SettingsStore.swift (2)
794-806: LGTM! Proper UserDefaults integration with default fallback.The property correctly persists the selected provider and defaults to
.autowhen no value is stored, allowing automatic selection based on architecture.
67-69: Key constant properly namespaced.The new key constant follows the existing pattern in the Keys enum.
Sources/Fluid/Services/TranscriptionProvider.swift (4)
7-15: LGTM! Clean result type with sensible defaults.The ASRTranscriptionResult struct provides a unified result type with a default confidence of 1.0, which is appropriate for providers that don't compute confidence scores (like WhisperProvider).
19-45: Excellent provider abstraction.The TranscriptionProvider protocol cleanly abstracts ASR functionality across multiple backends. The prepare() method with optional progress handler enables async model downloads, and transcribe() is well-documented regarding the expected audio format (16kHz mono PCM).
48-51: Default implementations reduce boilerplate.Providing default no-op implementations for modelsExistOnDisk() and clearCache() allows providers to opt into these features only when needed.
56-75: Proper compile-time architecture detection.The CPUArchitecture enum uses compile-time conditionals (#if arch(arm64)) to detect Apple Silicon vs Intel, which is the correct approach for platform-specific feature gating. The helper properties (isAppleSilicon, isIntel) improve readability at call sites.
Sources/Fluid/Services/ThreadSafeAudioBuffer.swift (1)
6-45: Excellent thread-safe implementation.The ThreadSafeAudioBuffer correctly uses NSLock to protect all buffer operations. Key strengths:
- Consistent use of
defer { lock.unlock() }ensures locks are always released- Read operations (count, getPrefix, getAll) return copies, preventing external mutation
- The getPrefix() method properly clamps the length to prevent out-of-bounds access
- The clear() method's keepingCapacity parameter optimizes for repeated use
Fluid.xcodeproj/project.pbxproj (6)
11-11: SwiftWhisper integration looks correct.SwiftWhisper is properly added to the Frameworks build phase and package product dependencies.
Also applies to: 36-36, 84-84
421-428: Correct package reference using semantic versioning.The SwiftWhisper package reference correctly uses
upToNextMajorVersionwith minimum version 1.2.0, ensuring stable and reproducible builds. This is the proper approach that should be mirrored in Package.swift.
156-156: ARCHS configuration enables universal binary support.Changing ARCHS from
arm64to$(ARCHS_STANDARD)correctly enables building for both Apple Silicon (arm64) and Intel (x86_64) architectures, which aligns with the PR objective to add Intel support.Also applies to: 223-223, 282-282, 337-337, 330-330, 385-385
318-318: Version bump is consistent across the project.MARKETING_VERSION updated to 1.5.1 matches the Info.plist change.
Also applies to: 373-373
286-287: Code signing configuration updated for consistency.The CODE_SIGN_IDENTITY is set to "Apple Development" with Automatic code signing style, which is appropriate for development builds. The per-SDK override
[sdk=macosx*]ensures the correct identity is used for macOS targets.Also applies to: 341-342
290-290: Verify the Development Team change is authorized.DEVELOPMENT_TEAM has been updated to
V4J43B279Jacross all build configurations (lines 188, 255, 290, 345 in project.pbxproj). The old team IDJ67LH9U7BNis no longer present anywhere in the codebase. The team ID is also consistently referenced inscripts/check-team-id.shandSources/Fluid/Services/SimpleUpdater.swift, confirming the change is systematic and intentional.Only you can verify that
V4J43B279Jcorresponds to the correct Apple Developer account for code signing and distribution. Ensure you have valid code signing certificates provisioned for this team ID.Sources/Fluid/ContentView.swift (1)
523-527: ASR error alert binding is correctly wiredThe new alert cleanly binds to
asr.errorTitle / errorMessage / showErrorand is consistent with the existing keychain alert pattern. This should give users clear feedback on provider/model failures without impacting other flows.
| { | ||
| "identity" : "swiftwhisper", | ||
| "kind" : "remoteSourceControl", | ||
| "location" : "https://github.com/exPHAT/SwiftWhisper.git", | ||
| "state" : { | ||
| "branch" : "master", | ||
| "revision" : "c340197966ebd264f3135d3955874b40f8ed58bc" | ||
| } | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Find and read the Package.resolved file
find . -name "Package.resolved" -type fRepository: altic-dev/FluidVoice
Length of output: 158
🌐 Web query:
SwiftWhisper GitHub releases version 1.2.0
💡 Result:
Yes — exPHAT/SwiftWhisper has a 1.2.0 release (published 2023-08-17). [1][2]
Sources:
[1] GitHub — exPHAT/SwiftWhisper.
[2] Swift Package Registry — SwiftWhisper (shows 1.2.0 and timestamp).
🌐 Web query:
SwiftWhisper exPHAT GitHub repository latest releases
💡 Result:
The latest release is v1.2.0 (released Aug 17, 2023). [1][2]
Sources:
- GitHub releases list for exPHAT/SwiftWhisper. [1]
- Swift Package Registry / Package index entry for SwiftWhisper (v1.2.0, 2023‑08‑17). [2]
🏁 Script executed:
# Read the main Package.resolved file
cat -n ./Package.resolved | grep -A 10 -B 2 "swiftwhisper"Repository: altic-dev/FluidVoice
Length of output: 505
🏁 Script executed:
# Read the workspace Package.resolved file
cat -n ./Fluid.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | grep -A 10 -B 2 "swiftwhisper"Repository: altic-dev/FluidVoice
Length of output: 505
🌐 Web query:
SwiftWhisper exPHAT GitHub version 1.2.0 commit hash revision
💡 Result:
The 1.2.0 release is the commit tagged a192004 (merge commit). [1][2]
Sources:
- GitHub releases (1.2.0) showing tag a192004. [1]
- Commit page for a192004. [2]
Synchronize main Package.resolved with workspace version: pin SwiftWhisper to v1.2.0.
The main Package.resolved file currently tracks the master branch, which causes inconsistency with the workspace file (already pinned to v1.2.0) and creates reproducibility risks. The workspace Package.resolved is already correctly configured; the main file needs to match.
Apply this diff to pin to version 1.2.0:
{
"identity" : "swiftwhisper",
"kind" : "remoteSourceControl",
"location" : "https://github.com/exPHAT/SwiftWhisper.git",
"state" : {
- "branch" : "master",
- "revision" : "c340197966ebd264f3135d3955874b40f8ed58bc"
+ "revision" : "a192004db08de7c6eaa169eede77f1625e7d23fb",
+ "version" : "1.2.0"
}
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { | |
| "identity" : "swiftwhisper", | |
| "kind" : "remoteSourceControl", | |
| "location" : "https://github.com/exPHAT/SwiftWhisper.git", | |
| "state" : { | |
| "branch" : "master", | |
| "revision" : "c340197966ebd264f3135d3955874b40f8ed58bc" | |
| } | |
| }, | |
| { | |
| "identity" : "swiftwhisper", | |
| "kind" : "remoteSourceControl", | |
| "location" : "https://github.com/exPHAT/SwiftWhisper.git", | |
| "state" : { | |
| "revision" : "a192004db08de7c6eaa169eede77f1625e7d23fb", | |
| "version" : "1.2.0" | |
| } | |
| }, |
🤖 Prompt for AI Agents
In Package.resolved lines 57-65 update the SwiftWhisper entry so it matches the
workspace pin: locate the "swiftwhisper" remoteSourceControl block and replace
the branch-based state with a version-based state for v1.2.0 (i.e., set
"version": "1.2.0") and update the "revision" value to the commit SHA that
corresponds to the v1.2.0 tag from the workspace Package.resolved; ensure the
entry now pins the dependency to version 1.2.0 instead of tracking "master" to
maintain reproducible builds.
| .package(url: "https://github.com/mxcl/PromiseKit", from: "6.0.0"), | ||
| .package(url: "https://github.com/MrKai77/DynamicNotchKit", from: "1.0.0") | ||
| .package(url: "https://github.com/MrKai77/DynamicNotchKit", from: "1.0.0"), | ||
| .package(url: "https://github.com/exPHAT/SwiftWhisper.git", branch: "master") |
There was a problem hiding this comment.
Pin SwiftWhisper to a semantic version for reproducible builds.
Using branch: "master" prevents reproducible builds and can introduce unexpected breaking changes. Pin to version 1.2.0 (as referenced in the Xcode workspace Package.resolved) or the latest stable release.
Apply this diff:
- .package(url: "https://github.com/exPHAT/SwiftWhisper.git", branch: "master")
+ .package(url: "https://github.com/exPHAT/SwiftWhisper.git", from: "1.2.0")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .package(url: "https://github.com/exPHAT/SwiftWhisper.git", branch: "master") | |
| .package(url: "https://github.com/exPHAT/SwiftWhisper.git", from: "1.2.0") |
🤖 Prompt for AI Agents
In Package.swift around line 16, the dependency currently uses branch: "master"
which prevents reproducible builds; replace that entry to pin SwiftWhisper to
the semantic version 1.2.0 (e.g. use exact: "1.2.0" or the equivalent
version-pinning syntax), then run swift package resolve (or update the Xcode
workspace) to refresh Package.resolved and commit the change.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
Sources/Fluid/Networking/ModelDownloader.swift (1)
1-7: Fix unmatched#if arch(arm64)and duplicateFoundationimport at top of file
- Line 2 duplicates the
Foundationimport from Line 1.- Lines 4–5 introduce two nested
#if arch(arm64)but only one#endifat Line 7, which—combined with the additional#if arch(arm64)at Line 303 and#endifat Line 387—leaves the preprocessor conditionals unbalanced and will break compilation.You can simplify and fix both issues with something like:
-import Foundation -import Foundation -import CoreML -#if arch(arm64) -#if arch(arm64) -import FluidAudio -#endif +import Foundation +import CoreML +#if arch(arm64) +import FluidAudio +#endifThis restores a single balanced conditional around
FluidAudioand removes the redundant import.
🧹 Nitpick comments (1)
Sources/Fluid/Networking/ModelDownloader.swift (1)
303-385: Avoid hard‑coding the vocab repo path inloadLocalAsrModelsIn
loadLocalAsrModels(from:),vocabPath(around Lines 358–361) is constructed as:let vocabPath = repoDirectory .deletingLastPathComponent() .appendingPathComponent("parakeet-tdt-0.6b-v3-coreml") .appendingPathComponent("parakeet_v3_vocab.json")This ties the loader to a specific repo name and ignores the actual
repoDirectorypassed in (and therepoinitializer parameter). IfHuggingFaceModelDownloaderis ever configured for a different ASR repo or if the directory name changes, this will fail even when the correct vocab file is present.Consider deriving the vocab path directly from
repoDirectory(or fromrepo) instead, e.g.:- let vocabPath = repoDirectory.deletingLastPathComponent() - .appendingPathComponent("parakeet-tdt-0.6b-v3-coreml") - .appendingPathComponent("parakeet_v3_vocab.json") + let vocabPath = repoDirectory.appendingPathComponent("parakeet_v3_vocab.json")or by making the vocab filename/repo name configurable.
Stability bug fixes in ASR Service and CoreAudio
Summary by CodeRabbit
New Features
Version Update
✏️ Tip: You can customize this high-level summary in your review settings.