Remove auto support for whisper_device; only cpu and cuda allowed

- Validate whisper_device in Settings and _get_local_model
- Reject 'auto' with clear ValueError/ValidationError
- Update docs in config, .env.example, README
- Add tests for invalid device and valid cpu/cuda

Co-authored-by: Ali Khokhar <alishahryar2@gmail.com>
This commit is contained in:
Cursor Agent 2026-02-18 13:38:59 +00:00
parent 2135e6da05
commit db646ef2db
6 changed files with 46 additions and 12 deletions

View file

@ -303,3 +303,20 @@ class TestSettingsOptionalStr:
monkeypatch.setenv("MESSAGING_PLATFORM", "discord")
s = Settings()
assert s.messaging_platform == "discord"
def test_whisper_device_auto_rejected(self, monkeypatch):
"""WHISPER_DEVICE=auto raises ValidationError (auto removed)."""
from config.settings import Settings
monkeypatch.setenv("WHISPER_DEVICE", "auto")
with pytest.raises(ValidationError, match="whisper_device"):
Settings()
@pytest.mark.parametrize("device", ["cpu", "cuda"])
def test_whisper_device_valid(self, monkeypatch, device):
"""Valid whisper_device values are accepted."""
from config.settings import Settings
monkeypatch.setenv("WHISPER_DEVICE", device)
s = Settings()
assert s.whisper_device == device