mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-04-28 11:30:03 +00:00
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:
parent
2135e6da05
commit
db646ef2db
6 changed files with 46 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue