Mercurial
diff dictation/config.py @ 282:6bd4a3990696 default tip
Add cross-platform canvas orchestration and typed composer
Enable native ARM dependencies, macOS Copilot orchestration, portable service supervision, CPU dictation, and a shared N-key speak-or-type composer.
Co-authored-by: Copilot <[email protected]>
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Thu, 20 Aug 2026 20:45:25 -0700 |
| parents | 49e9e591c9bb |
| children |
line wrap: on
line diff
--- a/dictation/config.py Tue Aug 18 22:18:15 2026 -0700 +++ b/dictation/config.py Thu Aug 20 20:45:25 2026 -0700 @@ -3,6 +3,7 @@ from dataclasses import dataclass import os from pathlib import Path +import sys MODEL_REPOSITORY = "Systran/faster-whisper-small" @@ -40,6 +41,7 @@ host: str port: int model_dir: Path + device: str compute_type: str max_sessions: int partial_interval_ms: int @@ -61,9 +63,15 @@ str(cache_root / "zenbu" / "faster-whisper-small"), ) ).expanduser() + device = os.environ.get( + "DICTATION_DEVICE", + "cpu" if sys.platform == "darwin" else "cuda", + ) + if device not in {"cpu", "cuda"}: + raise ValueError("DICTATION_DEVICE must be cpu or cuda") compute_type = os.environ.get( "DICTATION_COMPUTE_TYPE", - "int8_float16", + "int8" if device == "cpu" else "int8_float16", ) if compute_type not in { "float16", @@ -80,6 +88,7 @@ host=host, port=_integer("DICTATION_PORT", 8090, 1, 65535), model_dir=model_dir, + device=device, compute_type=compute_type, max_sessions=_integer("DICTATION_MAX_SESSIONS", 1, 1, 8), partial_interval_ms=_integer(