mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* iOS: Parakeet's preparation, compile record and load guard take a model name
A second Parakeet model (Parakeet Ultra, next commit) needs its own load guard
and compile record, and its own words while it downloads, without changing V2's.
- ParakeetLoadGuard(model:) and ParakeetCompileRecord(key:) name their
UserDefaults keys; the defaults ("parakeet.loadStartedAt",
"parakeet.loadInterrupted", "parakeet.compiledForSystem") are V2's keys as
before, so V2's state carries over.
- ParakeetLoadGuard.forget() clears an interrupted load, for a person who asks
to try again.
- ParakeetPreparationProgress takes the download's detail, defaulting to V2's
"Downloading the speech model".
- ParakeetProgressFeed is no longer private to ParakeetTranscriber.swift.
Nothing V2 does changes: same keys, same words, same progress.
Verified: xcodebuild test on an iPhone 17 Pro Max iOS 26.4 simulator (Mac
Studio), 575 tests, 0 failures, 1 skipped, with the next commit applied.
* iOS: Experiments › Multilingual model (Parakeet) dictates 25 languages, mixed in a sentence
A TestFlight tester (iPhone 17 Pro Max, iOS 26.6.2, build 56) asked for Parakeet
Ultra: they mix Dutch phrases and English words in one sentence, which Apple
Speech, one locale at a time, gets wrong, and Ultra on desktop Hex gets right.
The experiment is off by default. While it's on, Hex dictates Parakeet Ultra's
25 languages (Moondream's post-training of NVIDIA Parakeet TDT 0.6B v3, CC BY
4.0) with FluidInference's Core ML build of it; other languages keep the engine
Hex picks without it.
- MultilingualParakeetSettings (HEXShared, App Group): the switch, Ultra's
languages, and the rule both processes use: the language set, else the
keyboard's language Automatic follows, else the iPhone's first, on iPhones
with 6 GB or more.
- ParakeetUltraModel: the 18 files FluidAudio's v3 path reads, pinned to
revision 95eaa59 with sizes and SHA-256 (632 MB), downloaded into
Application Support (out of backups) with Range resume from a .partial and a
digest check before each file gets its name, hashed in 4 MB chunks drained
one at a time (without that the encoder's 594 MB stayed in memory during the
check). FluidAudio 0.15.5 has no .ultra (0.17.7 added it) and its loader
replaces a folder it can't load with v3's download, so Hex loads the four
models itself and hands FluidAudio v3 AsrModels. The pin stays at 0.15.5, so
V2 and everything else run the same FluidAudio as before.
- ParakeetUltraTranscriber: download through StallWatch (90 s, as V2), stopped
if the switch goes off mid-way; load and transcribe as V2. Chosen only with
1.5 GB left (os_proc_available_memory), as #2190 does for V2, and set aside
after a load that ended Hex or found too little memory (its own
ParakeetLoadGuard keys) until the switch is turned off and on; then home says
Hex uses its usual model.
- Engine choice: DictationController.defaultTranscriber and prepareAtLaunch ask
for Ultra first; with the switch off they only delete a download it left.
multilingualParakeetChanged prepares the new engine now, or after the
dictation in flight. Download failures count as interruptions, retried once
back in the foreground.
- Keyboard: the model can't load in a keyboard, so while Ultra takes the
dictation language, Dictate and the Hex key open Hex, as before iOS 26
(KeyboardViewController), and KeyboardSpeechPreparation follows the app
instead of downloading Apple's model. A warm session still dictates without
leaving the app.
- Settings › Experiments › "Multilingual model (Parakeet)": "25 languages,
even mixed in a sentence. 632.2 MB download. Keyboard dictation opens Hex.",
disabled with "Needs an iPhone with 6 GB of memory or more" below that. On
downloads it; off deletes it. The preparation bar (#2171) says "Downloading
632.2 MB · Wi-Fi recommended". zh-Hans for every new string.
- Acknowledgements and ios/README.md credit Parakeet Ultra, NVIDIA Parakeet TDT
0.6B v3 and FluidInference's conversion (CC BY 4.0).
- Onboarding's language line checks for "Parakeet V2" by name, not any
"Parakeet", so Ultra isn't taken for English.
Measured on the Mac Studio (~/dev/experiments/2026-11-21-hex-multilingual-parakeet,
159 macOS say clips: Dutch-English sentences spoken by Xander and Ellen and
spliced with Samantha, pure Dutch, pure English): word error rate on the mixed
sentences 7.5% for Ultra against 26.9% for Apple Speech nl-NL
(DictationTranscriber) and ~80% for Apple Speech en-US and Parakeet V2; pure
Dutch 0.9% (Apple nl-NL 0.4%), pure English 0% (Apple en-US 0%). Core ML on the
Mac: compile 7.4 s (V2 11.4 s), same speed as V2.
Verified: xcodebuild test on an iPhone 17 Pro Max iOS 26.4 simulator, 575
tests, 0 failures, 1 skipped, with new cases in DictationControllerTests (off
by default, language and memory rules, separate guard, download words, pinned
files, re-prepare on toggle). In that simulator a fresh install with the switch
on downloaded, checked and loaded Ultra in under 10 s and became ready, and the
app's ParakeetUltraTranscriber transcribed the test clips (a throwaway case,
not committed). The simulator has no microphone here and runs Core ML on the
CPU: a real iPhone must confirm load memory, Neural Engine compile time, speed,
the keyboard opening Hex, and dictation of real speech.
* iOS: Acknowledgements credit Parakeet V2
Hex downloads NVIDIA Parakeet TDT 0.6B v2 (FluidInference's Core ML conversion)
to dictate English, and its licence, CC BY 4.0, asks for credit, but
Settings › Acknowledgements and the README named only the data Hex ships and,
since the previous commit, Parakeet Ultra.
- AcknowledgementsView and ios/README.md's Acknowledgements credit NVIDIA's
model and FluidInference's conversion, both CC BY 4.0, with links, and say
the conversion stores the encoder at reduced precision and Hex uses it
unchanged.
FluidAudio stays at 0.15.5.
Verified: generic build (CODE_SIGNING_ALLOWED=NO) and xcodebuild test on an
iPhone 17 Pro Max simulator on the Mac Studio, all tests passing.
131 lines
6.5 KiB
Swift
131 lines
6.5 KiB
Swift
import SwiftUI
|
||
|
||
/// Settings › Acknowledgements: the data Hex ships, with the notices its licences ask for.
|
||
struct AcknowledgementsView: View {
|
||
@Environment(\.dismiss) private var dismiss
|
||
|
||
var body: some View {
|
||
NavigationStack {
|
||
ScrollView {
|
||
VStack(alignment: .leading, spacing: 20) {
|
||
ForEach(Self.entries, id: \.title) { entry in
|
||
VStack(alignment: .leading, spacing: 6) {
|
||
Text(entry.title)
|
||
.font(.system(size: 15, weight: .medium))
|
||
.foregroundStyle(HexTheme.textBase)
|
||
Text(entry.body)
|
||
.font(.system(size: 13))
|
||
.foregroundStyle(HexTheme.textMuted)
|
||
.textSelection(.enabled)
|
||
}
|
||
}
|
||
}
|
||
.padding(20)
|
||
.frame(maxWidth: .infinity, alignment: .leading)
|
||
}
|
||
.background(HexTheme.bgBase)
|
||
.navigationTitle("Acknowledgements")
|
||
.navigationBarTitleDisplayMode(.inline)
|
||
.toolbar {
|
||
ToolbarItem(placement: .confirmationAction) {
|
||
Button("Done") { dismiss() }
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
struct Entry {
|
||
let title: String
|
||
let body: String
|
||
}
|
||
|
||
/// Spatial autocorrect's word lists (`scripts/build-typing-model.py`), the keyboard's
|
||
/// never-suggest list (`OffensiveWords`), and the speech models Hex downloads (Parakeet V2,
|
||
/// and Parakeet Ultra for Experiments › Multilingual model); keep in step with ios/README.md.
|
||
static let entries: [Entry] = [
|
||
Entry(
|
||
title: "Google Books Ngram data",
|
||
body: """
|
||
Spatial autocorrect's word and word-pair frequencies, and German's capitalisation \
|
||
shares, come from the Google Books Ngram Viewer data, version 3 (2020), by Google, \
|
||
licensed under Creative Commons Attribution 3.0 (creativecommons.org/licenses/by/3.0). \
|
||
Hex sums the counts from 1980 to 2019 and keeps only words in the lists below.
|
||
"""
|
||
),
|
||
Entry(
|
||
title: "SCOWL",
|
||
body: """
|
||
English words are checked against SCOWL (Spell Checker Oriented Word Lists) and \
|
||
VarCon by Kevin Atkinson, sizes up to 70 (wordlist.aspell.net).
|
||
|
||
Copyright 2000-2018 by Kevin Atkinson
|
||
|
||
Permission to use, copy, modify, distribute and sell these word lists, the \
|
||
associated scripts, the output created from the scripts, and its documentation \
|
||
for any purpose is hereby granted without fee, provided that the above copyright \
|
||
notice appears in all copies and that both that copyright notice and this \
|
||
permission notice appear in supporting documentation. Kevin Atkinson makes no \
|
||
representations about the suitability of this array for any purpose. It is \
|
||
provided "as is" without express or implied warranty.
|
||
|
||
SCOWL's inflections come from WordNet 1.6, Copyright 1997 by Princeton \
|
||
University. All rights reserved. THIS SOFTWARE AND DATABASE IS PROVIDED "AS IS" \
|
||
AND PRINCETON UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR \
|
||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PRINCETON UNIVERSITY MAKES NO \
|
||
REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR \
|
||
PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE, DATABASE OR DOCUMENTATION WILL \
|
||
NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. The \
|
||
name of Princeton University or Princeton may not be used in advertising or \
|
||
publicity pertaining to distribution of the software and/or database.
|
||
|
||
Its other sources (12Dicts, Moby Words II, and Brian Kelk's UK English Wordlist) \
|
||
are in the public domain.
|
||
"""
|
||
),
|
||
Entry(
|
||
title: "List of Dirty, Naughty, Obscene, and Otherwise Bad Words",
|
||
body: """
|
||
The keyboard's suggestion filter uses the List of Dirty, Naughty, Obscene, and \
|
||
Otherwise Bad Words (LDNOOBW), © 2012–2020 Shutterstock, Inc., and contributors: \
|
||
its English, Spanish, German and Norwegian lists, revision 5faf2ba \
|
||
(github.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words), \
|
||
licensed under Creative Commons Attribution 4.0 International \
|
||
(creativecommons.org/licenses/by/4.0). Hex lowercased and classified the entries, \
|
||
omitted ordinary, medical and search-only terms, and added common slurs, \
|
||
inflections and spelling variants.
|
||
"""
|
||
),
|
||
Entry(
|
||
title: "Parakeet V2",
|
||
body: """
|
||
Hex dictates English with NVIDIA's Parakeet TDT 0.6B v2 \
|
||
(huggingface.co/nvidia/parakeet-tdt-0.6b-v2), licensed under Creative Commons \
|
||
Attribution 4.0 International (creativecommons.org/licenses/by/4.0), downloaded as \
|
||
FluidInference's Core ML conversion (huggingface.co/FluidInference/\
|
||
parakeet-tdt-0.6b-v2-coreml, CC BY 4.0), which stores the encoder's weights at \
|
||
reduced precision; Hex uses its files unchanged.
|
||
"""
|
||
),
|
||
Entry(
|
||
title: "Parakeet Ultra",
|
||
body: """
|
||
Experiments › Multilingual model downloads Parakeet Ultra by Moondream \
|
||
(huggingface.co/moondream/parakeet-ultra), a post-training of NVIDIA's Parakeet \
|
||
TDT 0.6B v3 (huggingface.co/nvidia/parakeet-tdt-0.6b-v3), both licensed under \
|
||
Creative Commons Attribution 4.0 International \
|
||
(creativecommons.org/licenses/by/4.0). Core ML conversion by FluidInference \
|
||
(huggingface.co/FluidInference/parakeet-ultra-coreml, revision 95eaa59), which \
|
||
stores the encoder's weights as 8-bit integers and re-exports the decoder and \
|
||
joint; Hex uses its files unchanged.
|
||
"""
|
||
),
|
||
Entry(
|
||
title: "RLA-ES",
|
||
body: """
|
||
Spanish words are checked against RLA-ES, the Spanish spelling dictionaries for \
|
||
LibreOffice by Santiago Bosio and contributors (Spain and Mexico), used under the \
|
||
Mozilla Public License 1.1 (github.com/sbosio/rla-es).
|
||
"""
|
||
),
|
||
]
|
||
}
|