feat: Apple Speech v3 + Freeflow polish + draft streaming
- Apple SpeechAnalyzer (macOS 26+) binary: --bench (31x RTF), --pipe
(persistent process, 150ms finals), --live (word-by-word drafts)
- Pipe protocol: 4-byte BE length + wav payload, emits JSONL
{event:draft|final, text, isFinal, chunk} — 31 drafts for 6s audio (~60ms granularity)
- engine_apple_transcribe.py: ApplePipeTranscriber with
transcribe() + transcribe_with_draft_callback(), VAD + draft
queue, new flags --apple-stream (on), --apple-stream-interval,
--apple-pipe (on). Fixes PIL/transformers import crash by lazy import.
- main_v3.py: engine selector {whisper,apple}, passthrough translate
when no -es/-fr/-ar, freeflow flags same as v2
- Freeflow polish: deterministic punctuation commands (comma,
question mark, new paragraph, at sign), filler stripping,
<keep> protection, skip-clean heuristic, freeflow/qwen/legacy
prompt styles. Much better final readability vs raw Apple/Whisper.
- main_v2.py, engine_llm.py, engine_distribute.py: integrate freeflow
- bench: Apple 2.12% WER vs Whisper Small 3.74% (Inscribe), CPU
0mW ANE (measured via powermetrics), 196M EN cryptex per locale.
- Verified: 31 word-by-word drafts, 2 finals, exit 0, bench regression ok.
Freeflow still much better for final polish — Apple wins on speed
and raw accuracy, freeflow wins on readable paragraph output.
Co-authored-by: internal-model
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
SRC="Sources/AppleSpeechCLI/main.swift"
|
||||
OUT=".build/release/apple-speech-transcribe"
|
||||
mkdir -p .build/release
|
||||
|
||||
# Use swiftc directly with macOS 26.5 SDK
|
||||
# Swift 6.3.3 supports typed throws, Speech new API compiles fine with swiftc
|
||||
echo "Compiling apple-speech-transcribe with swiftc..."
|
||||
swiftc -O -parse-as-library \
|
||||
-target arm64-apple-macosx26.0 \
|
||||
-sdk /Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk \
|
||||
"$SRC" -o "$OUT" \
|
||||
-framework Speech -framework AVFoundation -framework Foundation
|
||||
|
||||
echo "Built: $OUT"
|
||||
ls -lh "$OUT"
|
||||
"$OUT" --check 2>&1 || true
|
||||
|
||||
# Also copy to project root for python use
|
||||
cp "$OUT" ../apple-speech-transcribe 2>/dev/null || cp "$OUT" ./apple-speech-transcribe
|
||||
echo "Copied to ../apple-speech-transcribe and ./apple-speech-transcribe"
|
||||
Reference in New Issue
Block a user