aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gui.py4
-rw-r--r--server.py4
2 files changed, 7 insertions, 1 deletions
diff --git a/gui.py b/gui.py
index 5f1dc38..89817e5 100644
--- a/gui.py
+++ b/gui.py
@@ -155,6 +155,9 @@ class _SettingsDialog(QDialog):
ollama_advanced_layout = QFormLayout(ollama_advanced_group)
ollama_advanced_layout.setLabelAlignment(Qt.AlignmentFlag.AlignLeft)
+ self.ollama_model_edit = QLineEdit(str(get_value("ollama_model", "qwen2.5:7b-instruct")), ollama_tab)
+ ollama_advanced_layout.addRow(QLabel("Ollama model:"), self.ollama_model_edit)
+
self.ollama_context_edit = QLineEdit(str(get_value("ollama_context_window", 6)), ollama_tab)
ollama_advanced_layout.addRow(QLabel("Context window (segments):"), self.ollama_context_edit)
@@ -240,6 +243,7 @@ class _SettingsDialog(QDialog):
"update_interval_seconds": update_interval_seconds,
"use_ollama_cleanup": self.use_ollama_cleanup_checkbox.isChecked(),
"ollama_device": self.ollama_device_combo.currentText(),
+ "ollama_model": self.ollama_model_edit.text().strip(),
"ollama_context_window": ollama_context_window,
"ollama_raw_batch_size": ollama_raw_batch_size,
}
diff --git a/server.py b/server.py
index 01c348e..21d292f 100644
--- a/server.py
+++ b/server.py
@@ -46,6 +46,7 @@ DEFAULT_SETTINGS: Dict[str, Any] = {
"update_interval_seconds": 2,
"use_ollama_cleanup": True,
"ollama_device": "GPU",
+ "ollama_model": "qwen2.5:7b-instruct",
"ollama_context_window": 5,
"ollama_raw_batch_size": 1,
}
@@ -431,7 +432,7 @@ def select_input_sample_rate(device_index: int, preferred_rate: int) -> int:
def main() -> None:
global CAPTURE_SAMPLE_RATE, MAX_SAMPLES, model, WHISPER_TASK, WHISPER_BEAM_SIZE, WHISPER_LANGUAGE
global BUFFER_SECONDS, PROCESS_INTERVAL_SECONDS, USE_OLLAMA_CLEANUP
- global OLLAMA_CONTEXT_WINDOW, RAW_BATCH_SIZE, subtitle_context
+ global OLLAMA_MODEL, OLLAMA_CONTEXT_WINDOW, RAW_BATCH_SIZE, subtitle_context
start_subtitle_server()
settings: Dict[str, Any] = load_settings()
@@ -450,6 +451,7 @@ def main() -> None:
USE_OLLAMA_CLEANUP = bool(settings.get("use_ollama_cleanup", True))
OLLAMA_OPTIONS["num_gpu"] = 0 if settings.get("ollama_device", "CPU").upper() == "CPU" else 1
+ OLLAMA_MODEL = "qwen2.5:7b-instruct" if str(settings.get("ollama_model", OLLAMA_MODEL)) is None else str(settings.get("ollama_model", OLLAMA_MODEL))
OLLAMA_CONTEXT_WINDOW = int(settings.get("ollama_context_window", 6))
subtitle_context = deque(maxlen=OLLAMA_CONTEXT_WINDOW)
RAW_BATCH_SIZE = int(settings.get("ollama_raw_batch_size", 3))
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage