Add local text correction engine

This commit is contained in:
2026-01-31 01:02:24 +02:00
parent 6a98142c1d
commit 32d4e328ff
10 changed files with 601 additions and 61 deletions

View File

@@ -17,6 +17,7 @@ from src.core.paths import get_base_path
DEFAULT_SETTINGS = {
"hotkey": "f8",
"hotkey_translate": "f10",
"hotkey_correct": "f9", # New: Transcribe + Correct
"model_size": "small",
"input_device": None, # Device ID (int) or Name (str), None = Default
"save_recordings": False, # Save .wav files for debugging
@@ -49,6 +50,11 @@ DEFAULT_SETTINGS = {
"condition_on_previous_text": True,
"initial_prompt": "Mm-hmm. Okay, let's go. I speak in full sentences.", # Default: Forces punctuation
# LLM Correction
"llm_enabled": False,
"llm_mode": "Standard", # "Grammar", "Standard", "Rewrite"
"llm_model_name": "llama-3.2-1b-instruct",
# Low VRAM Mode
@@ -102,9 +108,9 @@ class ConfigManager:
except Exception as e:
logging.error(f"Failed to save settings: {e}")
def get(self, key: str) -> Any:
def get(self, key: str, default: Any = None) -> Any:
"""Get a setting value."""
return self.data.get(key, DEFAULT_SETTINGS.get(key))
return self.data.get(key, DEFAULT_SETTINGS.get(key, default))