feat: migrate on-device Qwen3 ASR to CoreML for background Flow dictation
Replace MLX GPU inference with CoreML bundles so transcription continues while the host app is backgrounded. Adds model download and warm-up, vendored Qwen3Speech, and updates onboarding, settings, and copy for the ~1.6 GB CoreML package (iOS 18+).
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
// OnDeviceModel.swift
|
||||
// OSGKeyboard · Shared
|
||||
//
|
||||
// Identity of an on-device model the host app downloads and the
|
||||
// keyboard extension observes via App Group flags (the extension
|
||||
// cannot read the main app's Caches directory).
|
||||
|
||||
import Foundation
|
||||
|
||||
public enum OnDeviceModel: String, CaseIterable, Identifiable, Sendable {
|
||||
case qwen3ASR
|
||||
|
||||
public var id: String { rawValue }
|
||||
|
||||
/// CoreML inference bundle (`aufklarer/Qwen3-ASR-CoreML`), derived from
|
||||
/// official `Qwen/Qwen3-ASR-0.6B`.
|
||||
public var repoId: String {
|
||||
switch self {
|
||||
case .qwen3ASR: return "aufklarer/Qwen3-ASR-CoreML"
|
||||
}
|
||||
}
|
||||
|
||||
/// Tokenizer files (vocab / merges) pulled from the upstream Qwen repo.
|
||||
public var tokenizerRepoId: String {
|
||||
switch self {
|
||||
case .qwen3ASR: return "Qwen/Qwen3-ASR-0.6B"
|
||||
}
|
||||
}
|
||||
|
||||
public var displayName: String {
|
||||
switch self {
|
||||
case .qwen3ASR: return "Qwen3-ASR 0.6B (CoreML)"
|
||||
}
|
||||
}
|
||||
|
||||
public var approximateSizeMB: Int {
|
||||
switch self {
|
||||
case .qwen3ASR: return 1_600
|
||||
}
|
||||
}
|
||||
|
||||
public var compactSizeLabel: String {
|
||||
"\(approximateSizeMB)M"
|
||||
}
|
||||
|
||||
/// Settings list title: model name plus compact size.
|
||||
public var listTitle: String {
|
||||
"\(displayName) · \(compactSizeLabel)"
|
||||
}
|
||||
|
||||
public var repoAndSizeLabel: String {
|
||||
"\(repoId) · \(approximateSizeMB) MB"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user