feat: add audio.device and whisper.base_url to config defaults
This commit is contained in:
@@ -12,6 +12,10 @@ DEFAULTS = {
|
||||
"model": "large-v3",
|
||||
"language": "de",
|
||||
"device": "auto", # "auto" = use GPU if ROCm available, else CPU
|
||||
"base_url": "",
|
||||
},
|
||||
"audio": {
|
||||
"device": "",
|
||||
},
|
||||
"server": {
|
||||
"port": 8765,
|
||||
@@ -56,6 +60,7 @@ def _write_defaults():
|
||||
with open(CONFIG_PATH, "w") as f:
|
||||
f.write("# tüit Transkriptor config\n\n")
|
||||
f.write('[ollama]\nbase_url = "http://localhost:11434"\nmodel = "gemma3:12b"\n\n')
|
||||
f.write('[whisper]\nmodel = "large-v3"\nlanguage = "de"\ndevice = "auto"\n\n')
|
||||
f.write('[whisper]\nmodel = "large-v3"\nlanguage = "de"\ndevice = "auto"\nbase_url = ""\n\n')
|
||||
f.write('[audio]\ndevice = ""\n\n')
|
||||
f.write('[server]\nport = 8765\n\n')
|
||||
f.write(f'[output]\npath = "{DEFAULTS["output"]["path"]}"\n')
|
||||
|
||||
@@ -22,3 +22,16 @@ def test_config_creates_file_on_first_run():
|
||||
with patch("config.CONFIG_PATH", cfg_path):
|
||||
config.load()
|
||||
assert os.path.exists(cfg_path)
|
||||
|
||||
|
||||
def test_config_has_audio_and_whisper_base_url():
|
||||
import config
|
||||
from unittest.mock import patch
|
||||
import tempfile, os
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
cfg_path = os.path.join(tmpdir, "config.toml")
|
||||
with patch("config.CONFIG_PATH", cfg_path):
|
||||
cfg = config.load()
|
||||
assert "audio" in cfg
|
||||
assert cfg["audio"]["device"] == ""
|
||||
assert cfg["whisper"]["base_url"] == ""
|
||||
|
||||
Reference in New Issue
Block a user